Skip to content

Instantly share code, notes, and snippets.

@mxstrand
Created March 21, 2013 04:27
Show Gist options
  • Save mxstrand/5210676 to your computer and use it in GitHub Desktop.
Save mxstrand/5210676 to your computer and use it in GitHub Desktop.
1) Managing states Marking a state as default
Failure/Error: click_link "States"
ActionView::Template::Error:
undefined method `make_default_admin_state_path' for #<#<Class:0x000000071e0e90>:0x00000006be1260>
# ./app/views/admin/states/index.html.erb:7:in `block in _app_views_admin_states_index_html_erb___433868852152387488_63319760'
# ./app/views/admin/states/index.html.erb:4:in `each'
# ./app/views/admin/states/index.html.erb:4:in `_app_views_admin_states_index_html_erb___433868852152387488_63319760'
# (eval):2:in `click_link'
# ./spec/integration/managing_states_spec.rb:12:in `block (2 levels) in <top (required)>'
@lostincode
Copy link

Did you add this to routes.rb?

resources :states do
member do
get :make_default
end
end

@lostincode
Copy link

Just for clarity here is the full code in your routes.rb

namespace :admin do
root :to => "base#index"
resources :users do
resources :permissions
end
resources :states do
member do
get :make_default
end
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment