Guest User

Untitled

a guest
Jun 22nd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. before_filter :index_filter, :only => "index"
  2.  
  3. def index
  4. @events = @object.events.paginate(:page => params[:page])
  5. # Define to_s on your models
  6. flash[:notice] = "Filtering by #{@object}"
  7. elsif params[:t]
  8. @events = Event.find_bysomething
  9. else
  10. @events = Event.paginate(:page => params[:page])
  11. end
  12. end
  13.  
  14. def index_filter
  15. @object = if params[:person_id]
  16. User.find_by_permalink!(params[:person_id])
  17. elsif params[:place_id]
  18. Place.find_by_permalink!(params[:place_id])
  19. elsif params[:category_id]
  20. Category.find_by_permalink!(params[:category_id])
  21. end
  22. end
Add Comment
Please, Sign In to add comment