ruby on rails - Error Adding a Migration: `default_controller_and_action': missing :action (ArgumentError) -
i'm trying add following migration:
rails g migration addconfirmabletousers confirmation_token:string confirmed_at:datetime confirmation_sent_at:datetime unconfirmed_email:string
however, raised following error i'm unable troubleshoot:
/users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:179:in `default_controller_and_action': missing :action (argumenterror) /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:72:in `normalize_options!' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:60:in `initialize' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1308:in `new' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1308:in `add_route' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1287:in `decomposed_match' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1269:in `block in match' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1269:in `each' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1269:in `match' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:254:in `root' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1321:in `root' /users/tn/rails_projects/rails-prelaunch-signup/config/routes.rb:5:in `block in <top (required)>' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:289:in `instance_exec' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:289:in `eval_block' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:267:in `draw' /users/tn/rails_projects/rails-prelaunch-signup/config/routes.rb:1:in `<top (required)>' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:40:in `block in load_paths' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:40:in `each' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:40:in `load_paths' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:16:in `reload!' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:26:in `block in updater' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/activesupport-3.2.13/lib/active_support/file_update_checker.rb:78:in `call' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/activesupport-3.2.13/lib/active_support/file_update_checker.rb:78:in `execute' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:27:in `updater' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/application/finisher.rb:66:in `block in <module:finisher>' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing' /users/tn/rails_projects/rails-prelaunch-signup/config/environment.rb:5:in `<top (required)>' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/application.rb:103:in `require_environment!' /users/tn/.rvm/gems/ruby-2.0.0-rc1@global/gems/railties-3.2.13/lib/rails/commands.rb:25:in `<top (required)>' script/rails:6:in `require' script/rails:6:in `<main>'
i thought might issue routes.rb file couldn't find issue it.
railsprelaunchsignup::application.routes.draw root to: "root_path" end
user.rb
class user < activerecord::base rolify # include default devise modules. others available are: # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable , :omniauthable devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable, :trackable, :validatable # setup accessible (or protected) attributes model attr_accessible :name, :email, :password, :password_confirmation, :remember_me end
any appreciated!
it indeed routes file:
root to: "root_path"
this should like:
root to: "controller#action"
root_path
helper name automatically generated rails when have root
definition in routes file.
Comments
Post a Comment