Hi I have in my view 2 variables @sd_resolution_id and @sd_ticket How can I pass this t controller..I tried the following but failed Please help <%= link_to_remote "Edit Resolution", :update => "create_sd_resolution_ui", :url => { :action => ''define_sd_resolution_ui'', :with => "''sd_resolution_id=''+ ''@sd_resolution_id'' + ''&id='' + escape($(''@sd_ticket''))"), %> Thanks in advance Sijo -- 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 -~----------~----~----~----~------~----~------~--~---
On 12 Mar 2008, at 12:39, Sijo Kg wrote:> > Hi > > I have in my view 2 variables > @sd_resolution_id and @sd_ticket > > How can I pass this t controller..I tried the following but failed > Please help > > <%= link_to_remote "Edit Resolution", > :update => "create_sd_resolution_ui", > :url => { :action => > ''define_sd_resolution_ui'', > :with => "''sd_resolution_id=''+ ''@sd_resolution_id'' + ''&id='' + > escape($(''@sd_ticket''))"),:with is a javascript fragment, so something like "{sd_resolution_id: @sd_resolution_id, id: escape($(''@sd_ticket''))}" is probably about right. in this particular case, can''t you just do> <%= link_to_remote "Edit Resolution", > :update => "create_sd_resolution_ui", > :url => { :action => > ''define_sd_resolution_ui'', :id => @sd_ticket, :sd_resolution_id => > @sd_resolution_id} %>? Fred> > %> > > Thanks in advance > Sijo > -- > 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 -~----------~----~----~----~------~----~------~--~---
Sijo Kg wrote:> How can I pass this t controller..I tried the following but failed > Please help > > <%= link_to_remote "Edit Resolution", > :update => "create_sd_resolution_ui", > :url => { :action => > ''define_sd_resolution_ui'', > :with => "''sd_resolution_id=''+ ''@sd_resolution_id'' + ''&id='' + > escape($(''@sd_ticket''))"), > %>:with is for passing in javascript ,not for passing parameters to the URL. In all functions which create a URL, you can pass in extra parameters in the URL specification part. In your example, you''d want something like: <%= link_to_remote "Edit Resolution", :update => "create_sd_resolution_ui", :url => {:action => :define_sd_resolution_ui, :sd_resolution => @sd_resolution_id, :id => @sd_ticket} %> For more information have a look at the examples in the documentation: http://api.rubyonrails.com/classes/ActionView/Helpers/PrototypeHelper.html#M000958 -- 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 -~----------~----~----~----~------~----~------~--~---
Thanks for your replies -- 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 -~----------~----~----~----~------~----~------~--~---
Mark Bush wrote:> :with is for passing in javascript ,not for passing parameters to the > URL.Bit misleading there as I wasn''t thinking right at the time. It *is* for passing parameters, however it''s mainly useful for passing JavaScript values (or DOM values) as parameters. You *can* use it for passing Rails values, but it''s a bit ugly compared to putting them in the :url hash. -- 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 -~----------~----~----~----~------~----~------~--~---