Hi When showing form errors, why is the url different to the initial url? For example, to create a new user the url is "/user/new" But when displaying the error form, the url becomes just "/user" I''m using restful rails and my controller looks something like this: if @user.save flash[:notice] = ''User was successfully created.'' format.html { redirect_to :users_url} else format.html { render :action => "new" } end Is there a way to make the url consistently "/user/new" ?? 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-/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 -~----------~----~----~----~------~----~------~--~---
Any ideas, anyone? On 17/11/2006, at 6:08 PM, Jason Bowerman wrote:> Hi > > When showing form errors, why is the url different to the initial url? > > For example, to create a new user the url is "/user/new" > > But when displaying the error form, the url becomes just "/user" > > I''m using restful rails and my controller looks something like this: > > if @user.save > flash[:notice] = ''User was successfully created.'' > format.html { redirect_to :users_url} > else > format.html { render :action => "new" } > end > > Is there a way to make the url consistently "/user/new" ?? > > 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-/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''re not getting an answer cos it''s an easy one. What action does your form post to? On 11/17/06, Jason B <jasjbow-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Any ideas, anyone? > > > On 17/11/2006, at 6:08 PM, Jason Bowerman wrote: > > > Hi > > > > When showing form errors, why is the url different to the initial url? > > > > For example, to create a new user the url is "/user/new" > > > > But when displaying the error form, the url becomes just "/user" > > > > I''m using restful rails and my controller looks something like this: > > > > if @user.save > > flash[:notice] = ''User was successfully created.'' > > format.html { redirect_to :users_url} > > else > > format.html { render :action => "new" } > > end > > > > Is there a way to make the url consistently "/user/new" ?? > > > > 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-/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 -~----------~----~----~----~------~----~------~--~---