×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
1
Language: Ruby
Posted by: Bartosz Walecki
Added: Apr 12, 2017 8:55 AM
Views: 2334
Tags: rails
  1. def edit
  2.   @post = Load.scoped_by_user_id(session[:user_id]).find(params[:id])
  3. rescue ActiveRecord::RecordNotFound
  4.   flash[:notice] = "Wrong post it"
  5.   redirect_to :action => 'index'
  6. end