Forum: Ruby on Rails sending parameters from view to method in controller

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
67654ec62eab59ae168f2c58250d65dd?d=identicon&s=25 raj ma (Guest)
on 2007-05-22 22:56
this my show method
def showa
    @posts=Post.find(:all, :conditions => "title LIKE 'a%'", :order=>
"id DESC")
    render :action => 'list'

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.
6b554084eb8bcb53a1c97864d8c4ca0d?d=identicon&s=25 Husein Choroomi (Guest)
on 2007-05-23 02:02
(Received via mailing list)
In View:
<%= link_to "A", :action => "show", :letter => 'a' %>

In Controller:
letter = params[:letter]

- H

On 5/23/07, Ravindraraj Mamadgi <>
> <%= link_to 'A', :action => 'showa' %>
Husein Choroomi,
Yucca Intelligence Development

We make the web a better place!
This topic is locked and can not be replied to.