Guest User

Untitled

a guest
Feb 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. ## Achieving what I want to
  2. # view #
  3. # with is the power
  4. <%= observe_field :suchbegriff,
  5. :frequency => 0.2,
  6. :loading => "Element.show('spinner1')",
  7. :complete => "Element.hide('spinner1')",
  8. :update => "webloglist",
  9. :url => { :action => "search_title",
  10. :controller => "weblog"},
  11. :with => "search" %>
  12.  
  13.  
  14. %= pagination_links @weblog_pages,
  15. :window_size => 3,
  16. :params => {:search => params[:search] } %>
  17.  
  18.  
  19. # controller #
  20. def search_title
  21. suchbegriff = '%' + params[:search] + '%'
  22. @weblog_pages, @weblogs = paginate :weblogs,
  23. :per_page => 10,
  24. :order => 'id desc',
  25. :conditions => ["title like ?", suchbegriff]
  26. render :partial => "list", :layout => !request.xhr?
  27. end
Add Comment
Please, Sign In to add comment