Ruby on rails error with log in -
i changed things in files , when user being created instead of going user/1 going user.1. idea why happening? below print of log extract. thanks,
started "/user.113" 95.45.98.59 @ 2016-04-18 23:39:53 +0000 actioncontroller::routingerror (uninitialized constant usercontroller): activesupport (4.2.2) lib/active_support/inflector/methods.rb:261:in const_get' activesupport (4.2.2) lib/active_support/inflector/methods.rb:261:inblock in constantize' activesupport (4.2.2) lib/active_support/inflector/methods.rb:259:in each' activesupport (4.2.2) lib/active_support/inflector/methods.rb:259:ininject' activesupport (4.2.2)
if you're using route helper method, , want route url specific resource, make sure call resource_path(resource)
, not resources_path(resource)
. note singular/plural distinction in route method.
if understand question correctly, controller should this;
class userscontroller < applicationconroller # ... def create # create user... if @user.valid? redirect_to user_path(@user) # redirects `show` action else render :new # there errors, render form errors end end # ... end
Comments
Post a Comment