Hi I have created a model Request and after that created the controller for that with the name Request .I have also added in routes.rb map.resources :reuests Now in app/view/requests/new.html.erb I have <% form_tag @onboarding_request do |f| %> <% f.submit "Create" %> <%end %> But this goes to the index action of requestscontroller not to the create action But in the view source it is getting as method="post" What is the problem here..Why this not going to the create action?Please help 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 -~----------~----~----~----~------~----~------~--~---
Hi - A couple of syntax issues here, not sure if they are just typing errors on this feed or if you have done the same in your app map.resources :requests (no ''q'') submit tag should be <%= f.submit "Create" %> so it is rendered. What do you have in the create method in the controller? Perhaps it''s redirecting to the index? On 18 Feb, 10:20, Sijo Kg <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi > I have created a model Request and after that created the controller > for that with the name Request .I have also added in routes.rb > map.resources :reuests > > Now in app/view/requests/new.html.erb I have > > <% form_tag @onboarding_request do |f| %> > <% f.submit "Create" %> > <%end %> > > But this goes to the index action of requestscontroller not to > the create action But in the view source it is getting as method="post" > > What is the problem here..Why this not going to the create > action?Please help > > Thanks in advance > Sijo > -- > 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 -~----------~----~----~----~------~----~------~--~---
No it is not going to create action(I have a puts statement there) and there is no redirect in create action -- 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 -~----------~----~----~----~------~----~------~--~---
1. Request is a reserved word in Rails; you must choose another name for your model. 2. If you''re using RESTful controllers (as Rails scaffolding does by default) then your forms will POST to the plural form of your model, for example a Blog would POST to /blogs to create. Rails controllers understand the REST verbs. On Feb 18, 5:20 am, Sijo Kg <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi > I have created a model Request and after that created the controller > for that with the name Request .I have also added in routes.rb > map.resources :reuests > > Now in app/view/requests/new.html.erb I have > > <% form_tag @onboarding_request do |f| %> > <% f.submit "Create" %> > <%end %> > > But this goes to the index action of requestscontroller not to > the create action But in the view source it is getting as method="post" > > What is the problem here..Why this not going to the create > action?Please help > > Thanks in advance > Sijo > -- > 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 -~----------~----~----~----~------~----~------~--~---