Hi all I just upgraded a project of mine from rails 2.1 to 2.2. Becouse of this upgrade, I have a link that doesn''t work anymore. I get an error when rendering the page: outgoing_invoice_url failed to generate from {:action=>"show", :override=>true, :controller=>"outgoing_invoices", :id=>"2297.pdf"}, expected: {:action=>"show", :controller=>"outgoing_invoices"}, diff: {:override=>true, :id=>"2297.pdf"} I have build the link as followed: <%= "#{outgoing_invoice_path("#{outgoing_invoice.id}.pdf", :override => true)}" %> It should render the link for the show action but also needs to send a parameter with it. This worked in Rails 2.1. I know that there are some routing changes in rails 2.2, but I can''t see what is wrong with mine. Could anyone help me? Thanks in advance for the help. -- 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 could try to use formatted_items_path(:pdf) On Jan 7, 6:30 pm, Michael Rigart <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi all > > I just upgraded a project of mine from rails 2.1 to 2.2. Becouse of this > upgrade, I have a link that doesn''t work anymore. I get an error when > rendering the page: > > outgoing_invoice_url failed to generate from {:action=>"show", > :override=>true, :controller=>"outgoing_invoices", :id=>"2297.pdf"}, > expected: {:action=>"show", :controller=>"outgoing_invoices"}, diff: > {:override=>true, :id=>"2297.pdf"} > > I have build the link as followed: > > <%= "#{outgoing_invoice_path("#{outgoing_invoice.id}.pdf", :override => > true)}" %> > > It should render the link for the show action but also needs to send a > parameter with it. > This worked in Rails 2.1. I know that there are some routing changes in > rails 2.2, but I can''t see what is wrong with mine. > > Could anyone help me? > > Thanks in advance for the help. > -- > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
cassiozen wrote:> You could try to use formatted_items_path(:pdf) > > On Jan 7, 6:30�pm, Michael Rigart <rails-mailing-l...@andreas-s.net>formatted_items_path nor, formatted_item_path seems to work. Both result in a no method error. -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---