liftedmedia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-20 15:13 UTC
2 Quick SQL Questions: Paginate Conditions and Adding to Value
I have 2 quick SQL questions that all my googling couldnt come up with an answer 1. Paginate results based on 2 conditions I currently have sorthelper sorting based on title/author. I''d like the option to select based on 3 genres then be able to sort that through those results by title. I haven''t be able to see how to handle sorting with a variable condition. (codes below 2. How to add to current value How would I add to a current value in my table? value = value.current + value.new def upcoming items_per_page = 8 @total = Albums.count @sorter = SortingHelper::Sorter.new self, %w(artist album votes_count date created_at), @params[''sort''], @params[''order''], ''created_at'', ''asc'' @albums_pages, @albums = paginate :albumss, :order => @sorter.to_sql, :per_page => items_per_page render :layout => ''albums_upcoming'' end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
liftedmedia-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-May-20 15:13 UTC
2 Quick SQL Questions: Paginate Conditions and Adding to Value
I have 2 quick SQL questions that all my googling couldnt come up with an answer 1. Paginate results based on 2 conditions I currently have sorthelper sorting based on title/author. I''d like the option to select based on 3 genres then be able to sort that through those results by title. I haven''t be able to see how to handle sorting with a variable condition. (codes below 2. How to add to current value How would I add to a current value in my table? value = value.current + value.new --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---