haxuan lac
2013-Jun-06 20:37 UTC
Error if i don''t have ''create'' method in user_controller and only have ''new'' method
I''m trying with chapter 7 in RailsTutorial and have code in user_controller: def new @user = User.new end def create @user = User.new(params[:user]) if @user.save redirect_to root_url, :notice => "Signed up!" else render "new" end end if I remove ''create'' method and Running App then have error : The action ''create'' could not be found for UsersController I don''t know why have to ''create'' method''? and how to fix this problem if not using ''create'' method. Thanks.... -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/980f3ed759ead38e939beea918e9b453%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
haxuan lac
2013-Jun-06 21:11 UTC
Re: Error if i don''t have ''create'' method in user_controller and only have ''new'' method
Sorry,I can know about this problem. I think after click in submit Form and Post action of Form is called and in Route : POST /users(.:format) users#create this is reason that this app have to do ''create'' method -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8fe8baea95669eb4620d95040ddfa664%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.