Hello all, I''m relatively new to rails and have been doing ok with it but I have run into an issue that I''m sure has a really easy solution that I just can''t seem to see. Basically I have an app and have namespaced and admin section to it. I''m getting the following error: No route matches {:action=>"show", :controller=>"admin/carriers"} The code at fault is this <%= form_for(@carrier, :url => admin_carrier_path, :html => { :multipart => true }) do |f| %> Basically I''m trying to create a new carrier but the form won''t render due to that error. In my routes file I have the following code. namespace :admin do resources :carriers end And rake routes does show a route that should match. I''m using rails 3.0.3 if that is any help. Any help would be greatly appreciated. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 9, 1:10 pm, JD <jdg....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello all, > > I''m relatively new to rails and have been doing ok with it but I have > run into an issue that I''m sure has a really easy solution that I just > can''t seem to see. >Do you want admin_carriers_path? You can probably simplify things simply by saying form_for([:admin, @carrier], :html => {:multipart => true}} Fred> Basically I have an app and have namespaced and admin section to it. > I''m getting the following error: > > No route matches {:action=>"show", :controller=>"admin/carriers"} > > The code at fault is this > > <%= form_for(@carrier, :url => admin_carrier_path, :html => > { :multipart => true }) do |f| %> > > Basically I''m trying to create a new carrier but the form won''t render > due to that error. In my routes file I have the following code. > > namespace :admin do > resources :carriers > end > > And rake routes does show a route that should match. I''m using rails > 3.0.3 if that is any help. > > Any help would be greatly appreciated.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Well I''ve figured this one out so no worries. On Jan 9, 1:10 pm, JD <jdg....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello all, > > I''m relatively new to rails and have been doing ok with it but I have > run into an issue that I''m sure has a really easy solution that I just > can''t seem to see. > > Basically I have an app and have namespaced and admin section to it. > I''m getting the following error: > > No route matches {:action=>"show", :controller=>"admin/carriers"} > > The code at fault is this > > <%= form_for(@carrier, :url => admin_carrier_path, :html => > { :multipart => true }) do |f| %> > > Basically I''m trying to create a new carrier but the form won''t render > due to that error. In my routes file I have the following code. > > namespace :admin do > resources :carriers > end > > And rake routes does show a route that should match. I''m using rails > 3.0.3 if that is any help. > > Any help would be greatly appreciated.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On Jan 9, 6:14 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jan 9, 1:10 pm, JD <jdg....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello all, > > > I''m relatively new to rails and have been doing ok with it but I have > > run into an issue that I''m sure has a really easy solution that I just > > can''t seem to see. > > Do you want admin_carriers_path? You can probably simplify things > simply by saying form_for([:admin, @carrier], :html => {:multipart => > true}} > > FredThanks for that Fred! That''s not what I did but it seems a better approach. I ended up doing :url => { :action => "create" }. One further question would [:admin, @carrier] work in link_to for my destroy links? Currently i''m using admin_carrier_path(carrier). Thanks! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
yes, it will work On Jan 10, 1:34 am, JD <jdg....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jan 9, 6:14 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > On Jan 9, 1:10 pm, JD <jdg....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello all, > > > > I''m relatively new to rails and have been doing ok with it but I have > > > run into an issue that I''m sure has a really easy solution that I just > > > can''t seem to see. > > > Do you want admin_carriers_path? You can probably simplify things > > simply by saying form_for([:admin, @carrier], :html => {:multipart => > > true}} > > > Fred > > Thanks for that Fred! That''s not what I did but it seems a better > approach. I ended up doing :url => { :action => "create" }. > > One further question would [:admin, @carrier] work in link_to for my > destroy links? Currently i''m using admin_carrier_path(carrier). > > Thanks!-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.