Ravindraraj Mamadgi
2007-May-22 20:56 UTC
sending parameters from view to method in controller
this my show method def showa @posts=Post.find(:all, :conditions => "title LIKE ''a%''", :order=> "id DESC") render :action => ''list'' end This is my view stmt <%= link_to ''A'', :action => ''showa'' %> I want to send A as parameter or any alphabet. This to view my posts in alphabetical order of there titles. Thank You. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Husein Choroomi
2007-May-23 00:01 UTC
Re: sending parameters from view to method in controller
In View: <%= link_to "A", :action => "show", :letter => ''a'' %> In Controller: letter = params[:letter] HTH - H On 5/23/07, Ravindraraj Mamadgi <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > this my show method > def showa > @posts=Post.find(:all, :conditions => "title LIKE ''a%''", :order=> > "id DESC") > render :action => ''list'' > end > > This is my view stmt > > <%= link_to ''A'', :action => ''showa'' %> > > I want to send A as parameter or any alphabet. This to view my posts in > alphabetical order of there titles. > > Thank You. > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Husein Choroomi, CEO, CTO Yucca Intelligence Development http://www.YuccaHQ.com We make the web a better place! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---