rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org
2007-May-15 07:54 UTC
is there any hidden command in link_to function?
hi, i want to know how to pass hiddend values in link_to. if anybody know please tell me. Thanks in addvane. -- 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 -~----------~----~----~----~------~----~------~--~---
you can use :method => :post as a aprameter for the options hash. This will create some javascript which will make the link submit by POST rather then GET. That way, the parameters won''t show up in the URL. but of course the "hidden" parameters will still be in the pages'' source code. On 15 Mai, 09:54, rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org wrote:> hi, > > i want to know how to pass hiddend values in link_to. if anybody know > please tell me. > > Thanks in addvane. > > -- > 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 -~----------~----~----~----~------~----~------~--~---
rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org
2007-May-15 09:32 UTC
Re: is there any hidden command in link_to function?
Thorsten wrote:> you can use :method => :post > as a aprameter for the options hash. This will create some javascript > which will make the link submit by POST rather then GET. > That way, the parameters won''t show up in the URL. but of course the > "hidden" parameters will still be in the pages'' source code.Thanks for ur reply. i did like this. but value is not passing. link_to "Edit", :action=>"user", :method => post, :values => { id => user.id } but its not working -- 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 -~----------~----~----~----~------~----~------~--~---
it''s :method => :post not :method => post On 5/15/07, rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Thorsten wrote: > > you can use :method => :post > > as a aprameter for the options hash. This will create some javascript > > which will make the link submit by POST rather then GET. > > That way, the parameters won''t show up in the URL. but of course the > > "hidden" parameters will still be in the pages'' source code. > > > Thanks for ur reply. i did like this. but value is not passing. > > link_to "Edit", :action=>"user", :method => post, :values => { id => > user.id } > > but its not working > > -- > 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 -~----------~----~----~----~------~----~------~--~---
and it doesn''T belong in the URL hash, but in the options hash ... link_to "Edit", { :action=>"user", :id => user.id }, {:method => :post } On 15 Mai, 12:14, "Chris Hall" <christopher.k.h...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> it''s > > :method => :post > > not > > :method => post > > On 5/15/07, rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > > > > <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > Thorsten wrote: > > > you can use :method => :post > > > as a aprameter for the options hash. This will create some javascript > > > which will make the link submit by POST rather then GET. > > > That way, the parameters won''t show up in the URL. but of course the > > > "hidden" parameters will still be in the pages'' source code. > > > Thanks for ur reply. i did like this. but value is not passing. > > > link_to "Edit", :action=>"user", :method => post, :values => { id => > > user.id } > > > but its not working > > > -- > > Posted viahttp://www.ruby-forum.com/.- Zitierten Text ausblenden - > > - Zitierten Text anzeigen ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > link_to "Edit", :action=>"user", :method => post, :values => { id => > user.id } > > but its not workingas chris hall posted, as well as passing the :values next to the :action call like so: link_to "Edit", ({:action => "user", :id => user.id}, :method => :post) -- 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 -~----------~----~----~----~------~----~------~--~---
rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org
2007-May-15 11:08 UTC
Re: is there any hidden command in link_to function?
Thorsten wrote:> and it doesn''T belong in the URL hash, but in the options hash ... > > link_to "Edit", { :action=>"user", :id => user.id }, {:method > => :post }hi, I used this command. but still id is displying. for me, id shouldn''t display in the browser. it should be a hidden field. can any one help me please -- 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 -~----------~----~----~----~------~----~------~--~---
Hi,>> link_to "Edit", { :action=>"user", :id => user.id }, {:method >> => :post } >> I used this command. but still id is displying. for me, id shouldn''t display in the browser. it should be a hidden field.Everything is fine now with your link_to. The only problem here is that "id" is a somehow special field in rails, as are also controller and action. Those parameters are automagically matched according to the rules defined in the routes.rb file, so if you are using id, link_to is going to use the route defined by " map.connect '':controller/:action/:id''". If you don''t like that, you have one of two options: either change the route in routes.rb or use a different parameter than id, and then in your controller read that from the params object. Regards, javier ramirez --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ok, i''m confused, what are you expecting this method to do for you? you say "id is displying for me, id shouldn''t display in the browser. it should be a hidden field." so which is it? a link or a hidden form field? Chris On 5/15/07, rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Thorsten wrote: > > and it doesn''T belong in the URL hash, but in the options hash ... > > > > link_to "Edit", { :action=>"user", :id => user.id }, {:method > > => :post } > > hi, > > I used this command. but still id is displying. for me, id shouldn''t > display in the browser. it should be a hidden field. can any one help me > please > > -- > 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 -~----------~----~----~----~------~----~------~--~---