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
On 1/4/06, sekhar <sekhar.konuru@gmail.com> wrote:>
> 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
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060104/fb60cb29/attachment.html