Hi,
I know I have been a little "long winded" but I really need to use link
to do a post/submit. It is in one of the requirements of the project I
am doing now.
I have tried using <%= link_to_function 'Next',
"$('update_product').submit()" -%>. It works though. But I can't have
two of this link_to_functions and redirect each link to a different
page. And I had got a feed back saying this link_to_function is a
complicated way of doing link. So I tried using <%= link_to 'PREVIOUS',
{:controller => 'create_user',
:action => "save_user" , :method => :post} %>
But this doesn't work as it does not post the values I keyed into the
various fields. Instead, it posts an ampty form. I really hope someone
can help me with is problem.
The project is not following the conventions of Rails. There are helpers (ala submit_tag) already in place to make this easier in you. Is this a work project or a school project?
The reason why: %= link_to ‘PREVIOUS’,
{:controller => ‘create_user’,
:action => “save_user” , :method => :post} is not working is because you’re not passing in the parameters. It’s kind of like trying to go to http://google.com and expecting it to have already looked up what you wanted to search for.
The project is not following the conventions of Rails. There are helpers
(ala submit_tag) already in place to make this easier in you. Is this a
work
project or a school project?
The reason why: %= link_to 'PREVIOUS',
{:controller => 'create_user',
:action => "save_user" , :method => :post} is not
working is because you're not passing in the parameters. It's kind of
like
trying to go to http://google.com and expecting it to have already
looked up
what you wanted to search for.
complicated way of doing link. So I tried using <%= link_to 'PREVIOUS',
>
Hi,
Its kink of a school project. So how do I pass the parameters in ?
I don't know if this is the right way to pass parameters but I got
values 0 for each fields that was being entered into my database.Did I
do it correctly?
You could set a javascript function on the onClick event of the link
which would do a .click on a button with style="visibility:hidden;" I
guess... but It's not really an elegant solution.