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. Thanks :) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. On Jan 15, 2008 4:20 PM, user splash <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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. > > Thanks :) > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ryan Bigg wrote:> 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. > > On Jan 15, 2008 4:20 PM, user splash <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > >> 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 ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
user splash wrote:> > Hi, > > Its kink of a school project. So how do I pass the parameters in ?Hi, This is what I did to try to oass the parameters: <%= link_to ''PREVIOUS'', {:controller => ''create_user'', :action => "save_user", :user => {:username=> ''username'', :password=> ''password'', :age => ''age''}, :method => :post} %> 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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
No. Just use a submit_tag, it is MUCH easier. I cannot help you further. On Jan 15, 2008 8:10 PM, user splash <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > user splash wrote: > > > > Hi, > > > > Its kink of a school project. So how do I pass the parameters in ? > > > Hi, > This is what I did to try to oass the parameters: > > <%= link_to ''PREVIOUS'', {:controller => ''create_user'', > :action => "save_user", :user => {:username=> ''username'', > :password=> ''password'', :age => ''age''}, :method => :post} %> > > 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? > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
:url => { :controller => create_user, :action => ''save_user'', }, :with => "''address=''+encodeURIComponent($F(''text_field_name))", :method => :post from here http://ariejan.net/2007/02/21/ror-link_to_remote-with-a-text_field-value-as-an-argument/ On Jan 15, 1:53 pm, Emanuele Ricci <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---