Forum: Ruby on Rails noob help

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
sekhar (Guest)
on 2006-01-04 22:42
(Received via mailing list)
I am writing an app with i18n , so my main.rhtml has this option

<%= start_form_tag :action => 'lang_hi' %>
<%= select "Lang","language",['Telugu','Hindi']%>
<%= submit_tag "Go" %>
<%= end_form_tag %>

the above way i am able to call only one action , is there a way i can
call any actiondepending on the selected language ,
or how can i write a for loop to execute the action according to the
language selected ,
my actions are in application.rb
or how can i write a helper file

Please guide me in this
Belorion (Guest)
on 2006-01-05 00:23
(Received via mailing list)
My first inclination would be to do a redirect within the "lang_hi"
action
depending on which language was selected:

def lang_hi()
   redirect_to( :controller => "foo", :action => "bar" )    if
@params[:language] == "Telugu"
    # etc
end

To the best of my knowledge, the only way to change the POST action of a
form is via javascript (such as using onSelect()).

Does that answer your question?

-Matt
sekhar (Guest)
on 2006-01-05 13:11
(Received via mailing list)
Yeah it answered and thank you for the help
This topic is locked and can not be replied to.