Skip to content

Instantly share code, notes, and snippets.

@alan707
Last active December 10, 2015 17:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save alan707/4469350 to your computer and use it in GitHub Desktop.
def show
@user=User.find(params[:id])
@user.set_view_profile(@user.id, false)
@rental_agreements = RentalAgreement.where(:owner_id => @user.id)
@tools = Tool.where(:user_id => @user.id)
respond_to do |format|
format.html # show.html.erb
format.json { render json: @user }
end
rescue ActiveRecord::RecordNotFound
flash[:notice] = "Something went horrible"
redirect_to :action => 'show'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment