I''m trying to generate a URL of the form controller/action?id=<id>&type=<type>. My code looks like this: url_for(:controller => ''content'', :action => ''get_resource'',:id => item[''Id''],:type => item[''type''] ) The url I end up with looks like this: http://localhost:3000/content/get_resource?type=<type> (the <type> is correct, the issue is tha the ID is entirely missing). What am I doing wrong here? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060504/fbaa54a4/attachment.html
On 5/5/06, Rakesh Malik <tamerlin@gmail.com> wrote:> > I''m trying to generate a URL of the form > controller/action?id=<id>&type=<type>. My code looks like this: > > url_for(:controller => ''content'', > :action => ''get_resource'',:id => item[''Id''],:type => item[''type''] > ) > > The url I end up with looks like this: > http://localhost:3000/content/get_resource?type=<type> > (the <type> is correct, the issue is tha the ID is entirely missing). >Fairly certain you need to drop the [''id''] e.g. url_for :controller => ''content'', :action => ''get_resource'', :id => item, :type => item[''type''] cheers, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060504/59a49047/attachment.html
Rakesh Malik wrote:> I''m trying to generate a URL of the form > controller/action?id=<id>&type=<type>. My code looks like this: > > url_for(:controller => ''content'', > :action => ''get_resource'',:id => item[''Id''],:type => item[''type''] > ) > > The url I end up with looks like this: > http://localhost:3000/content/get_resource?type=<type> > (the <type> is correct, the issue is tha the ID is entirely missing). > > What am I doing wrong here?The capital I in ''Id'' should be lower-case. -- We develop, watch us RoR, in numbers too big to ignore.
Thanks for the suggestions. I''ll see what happens tomorrow when I get back to the office. On 5/5/06, Mark Reginald James <mrj@bigpond.net.au> wrote:> > Rakesh Malik wrote: > > I''m trying to generate a URL of the form > > controller/action?id=<id>&type=<type>. My code looks like this: > > > > url_for(:controller => ''content'', > > :action => ''get_resource'',:id => item[''Id''],:type => item[''type''] > > ) > > > > The url I end up with looks like this: > > http://localhost:3000/content/get_resource?type=<type> > > (the <type> is correct, the issue is tha the ID is entirely missing). > > > > What am I doing wrong here? > > The capital I in ''Id'' should be lower-case. > > > -- > We develop, watch us RoR, in numbers too big to ignore. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060505/102eb08d/attachment.html