Skip to content

Commit

Permalink
refactor controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Salazar committed Jan 25, 2017
1 parent 3ab420e commit e21bc17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/recommendations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ def index
end

if @error.present?

respond_to do |format|
format.html do
flash[:alert] = @error
redirect_to root_path and return
redirect_to root_path
end
format.json do
render json: @error, status: :not_found and return
render json: @error, status: :not_found
end
end
return
end

per = params.fetch :per, 4
Expand Down

0 comments on commit e21bc17

Please sign in to comment.