I have a button and I want to write condition for two url. when I select
csv and click button, want to run work_sheet_csv, when I select one of
the templates, want to run converter.
how can I write condition for it.
thanks for any help…
Simplify your public interface and just use one action. Since
converter handles most of the possibilities, I’d default to it and
allow it to delegate to work_sheet_csv if necessary.
def convert
work_sheet_csv and return if params[:tempates]==‘work_sheet_csv’
… current convert code …
end
private
def work_sheet_csv
…
end
If that feels uncomfortable, then use a new action and let it simply
delegate all the calls to either converter or work_sheet_csv as
necessary.
in yr rails method u can check for the value("‘id=’+this.value") and
redirect it.
All the best
thank you very much for your help.
I have a question to your suggestion. first I need to use the value of
option
because another method need it as well. another thing is that it s not
object of form. selection is not used in form. lastly there will be
button which should realize the selection and run the suitable url. as
you see in selection there are some template names and work_sheet_csv. I
will use another selection if I manage to get parameter from selection.
I advice you to paste your both of your controllers and index.rhtml
using http://pastie.caboo.se/ and paste the links here, so they can
understand the main your problem. I believe they can solve the problem
if they can read your entire script, because your problem is how to call
first the url of csv from your javascript function that you wrote in
index.rhtml. I am not good in JS.
I advice you to paste your both of your controllers and index.rhtml
using http://pastie.caboo.se/ and paste the links here, so they can
understand the main your problem. I believe they can solve the problem
if they can read your entire script, because your problem is how to call
first the url of csv from your javascript function that you wrote in
index.rhtml. I am not good in JS.
Reinhart Ariando
my problem is that get parameter from selection which is not in form
object.
thank you very much for your help Reinhart Ariando. you spent your time
for me.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.