Hi,
I’m submitting a form to the “userconfirm” action of my
register_controller.rb file:
def userconfirm
@user = User.new(params[:user])
if @user.save
# Create session
redirect_to :controller => 'sessions', :action
=> ‘create’, :login => params[:login], :password => params[:password]
else
render :action => ‘userinfo’
end
end
But for some reason, I’m getting redirected to “/sesssions” (according
to the log file) and here’s the error I’m getting
Unknown action
No action responded to show
Below is my config/routes.rb file. Why am I getting this error when I
clearly redirect to the “create” action? Log file entry follows. -
Dave
=====================begin routes.rb=========================
ActionController::Routing::Routes.draw do |map|
map.connect ‘’, :controller => “register”, :action => “start”
map.resources :users
map.resource :sessions
map.signup ‘/signup’, :controller => ‘users’, :action => ‘new’
map.login ‘/login’, :controller => ‘sessions’, :action => ‘new’
map.logout ‘/logout’, :controller => ‘sessions’, :action =>
‘destroy’
The priority is based upon order of creation: first created →
highest priority.
Sample of regular route:
map.connect ‘products/:id’, :controller => ‘catalog’, :action =>
‘view’
Keep in mind you can assign values other than :controller
and :action
Sample of named route:
map.purchase ‘products/:id/purchase’, :controller =>
‘catalog’, :action => ‘purchase’
This route can be invoked with purchase_url(:id => product.id)
You can have the root of your site routed by hooking up ‘’
– just remember to delete public/index.html.
map.connect ‘’, :controller => “welcome”
Allow downloading Web Service WSDL as a file with an extension
instead of a file named ‘wsdl’
map.connect ‘:controller/service.wsdl’, :action => ‘wsdl’
Install the default route as the lowest priority.
map.connect ‘:controller/:action/:id.:format’
map.connect ‘:controller/:action/:id’
end
======================end routes.rb=======================
======================log/development.log==================
Processing RegisterController#userconfirm (for 67.190.94.163 at
2008-01-30 13:23:47) [POST]
Session ID:
BAh7CToMY3NyZl9pZCIlOTc3ODFlMGVhZWU2MDQ2YWVmOTUyMmI5MWQ0OTlm
%0AYzc6DnJldHVybl90bzA6EHBoYXJtYWN5X2lkIggxMjMiCmZsYXNoSUM6J0Fj
%0AdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA
%3D–4a3c120be536a24d8bc4a5f4236644c47df14731
Parameters: {“user”=>{“work_phone”=>“123-456-7890”,
“work_phone_extension”=>“”, “user_type_id”=>“2”,
“ship_to_last_name”=>“Alvarado”, “ship_to_city”=>“asddfsa”,
“password_confirmation”=>“dave”, “ship_to_street”=>“asdsdaf”,
“ship_to_zip”=>“78727”, “phone”=>“303-123-4567”,
“ship_to_first_name”=>“Dave”, “ship_to_state”=>“TX”,
“login”=>“dave304”, “password”=>“dave”, “email”=>“[email protected]”},
“commit”=>“Create”, “action”=>“userconfirm”, “controller”=>“register”}
^[[4;36;1mUser Columns (0.005564)^[[0m ^[[0;1mSHOW FIELDS FROM
users
^[[0m
^[[4;35;1mSQL (0.000205)^[[0m ^[[0mBEGIN^[[0m
^[[4;36;1mUser Load (0.003407)^[[0m ^[[0;1mSELECT * FROM users
WHERE (LOWER(users.login) = ‘dave304’) LIMIT 1^[[0m
^[[4;35;1mUser Load (0.003357)^[[0m ^[[0mSELECT * FROM users
WHERE (LOWER(users.email) = ‘[email protected]’) LIMIT 1^[[0m
VALIDATES_AS_PHONE: 3031234567 is the value 10 valid? true
^[[4;36;1mUser Create (0.037157)^[[0m ^[[0;1mINSERT INTO users
(created_on
, last_login
, pharmacy_id
, provincial_tax
, salt
,
tax
, work_phone
, work_phone_extension
, cc_company
,
cc_number
, discount
, ship_to_city
, ship_to_last_name
,
user_type_id
, cc_security_code
, comments
, company_name
,
crypted_password
, bill_to_attn
, bill_to_country
,
bill_to_street2
, demo
, ship_to_country
, updated_on
,
dateofbirth
, html_email_pref
, lock_order_form_prices
,
remember_token_expires_at
, ship_to_street
, ship_to_zip
,
show_retail_prices
, user_group_id
, bill_to_city
, enabled
,
bill_to_company
, user_agent
, fax
, phone
, remember_token
,
ship_to_attn
, ship_to_street2
, shipping
, bill_to_last_name
,
bill_to_street
, cc_exp_date
, reseller_id
, user_id
,
bill_to_state
, login
, ship_to_first_name
, ship_to_state
,
bill_to_first_name
, bill_to_zip
, email
, po_num
,
ship_to_company
) VALUES(‘2008-01-30 13:23:47’, NULL, NULL, 0.0,
‘6a71ee10804a17fee07e2c524dba2039971d2b3b’, 0.0, ‘123-456-7890’, ‘’,
NULL, NULL, 0.0, ‘asddfsa’, ‘Alvarado’, 2, NULL, NULL, ‘’,
‘7af9ccb951cf54803b5761251990d2550a402448’, NULL, NULL, NULL, 0, NULL,
‘2008-01-30 13:23:47’, NULL, 1, 0, NULL, ‘asdsdaf’, ‘78727’, 1, NULL,
NULL, 1, NULL, NULL, NULL, ‘303-123-4567’, NULL, NULL, NULL, 0.0,
NULL, NULL, NULL, NULL, NULL, NULL, ‘dave304’, ‘Dave’, ‘TX’, NULL,
NULL, ‘[email protected]’, NULL, NULL)^[[0m
^[[4;35;1mSQL (0.006645)^[[0m ^[[0mCOMMIT^[[0m
Redirected to http://remandev.no-ip.org:3000/sessions
Completed in 0.08216 (12 reqs/sec) | DB: 0.05633 (68%) | 302 Found
[http://remandev.no-ip.org/register/userconfirm]
=======================end entry in log======================