Guest User

Untitled

a guest
Jun 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. Some Controller
  2.  
  3. def something
  4. otheruser = 1
  5. otheruserurl = animals.find :url, :conditions => {:user_id = ?, otheruser}
  6. @user = User.find(params[:id])
  7. @show = @user.animals.find :all, :conditions => {:user_id = ?, @user, :url !=> otheruserurl}
  8. end
  9.  
  10. find all and display @user url that are not equal to otheruser's url
Add Comment
Please, Sign In to add comment