Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No route matches" for model named "News" #89

Closed
masv opened this issue May 24, 2011 · 10 comments
Closed

"No route matches" for model named "News" #89

masv opened this issue May 24, 2011 · 10 comments
Milestone

Comments

@masv
Copy link

masv commented May 24, 2011

Using ActiveAdmin for a model called "News" seems to not work properly. After creating a resource for the News model, visiting any ActiveAdmin page will raise an error such as this:

ActionController::RoutingError in Admin/dashboard#index
Showing /Library/Ruby/Gems/1.8/gems/activeadmin-0.2.1/lib/active_admin/views/templates/active_admin_dashboard/index.html.arb where line #1 raised:
No route matches {:action=>"show", :controller=>"admin/news"}

However, when renaming the resource with :as (to "Post", "Gherkin", or anything else that can be pluralized), the model and all views behave as expected.

The same error occurs when renaming any other model to "News" using :as, for example:

ActiveAdmin.register Post, :as => "News" do
end
@gregbell
Copy link
Contributor

Can you do a rake routes in your app and post the output.

@masv
Copy link
Author

masv commented May 24, 2011

rake routes with model named News:

admin_news_index GET    /admin/news(.:format)              {:action=>"index", :controller=>"admin/news"}
                 POST   /admin/news(.:format)              {:action=>"create", :controller=>"admin/news"}
  new_admin_news GET    /admin/news/new(.:format)          {:action=>"new", :controller=>"admin/news"}
 edit_admin_news GET    /admin/news/:id/edit(.:format)     {:action=>"edit", :controller=>"admin/news"}
      admin_news GET    /admin/news/:id(.:format)          {:action=>"show", :controller=>"admin/news"}
                 PUT    /admin/news/:id(.:format)          {:action=>"update", :controller=>"admin/news"}
                 DELETE /admin/news/:id(.:format)          {:action=>"destroy", :controller=>"admin/news"}

(Sorry for the formatting...)

@anwajler
Copy link
Contributor

Yep, the same for me. Everything works as expected except "News" resource, and I have all necessary routes.

@BBQ
Copy link

BBQ commented Jun 18, 2011

@ecleel
Copy link

ecleel commented Aug 13, 2011

issue still doesn't solve and the problem from active_admin itself not from rails because I create a rails project as a test and create news scaffold and It worked. but it didn't work in active_admin

@epochwolf
Copy link
Contributor

I am also having issues with this. I have a model named Series and I get a similar error message.

@pcreux
Copy link
Contributor

pcreux commented Aug 18, 2011

See issue #369.

@ecleel
Copy link

ecleel commented Aug 18, 2011

Thanks pcreux. I hope will be fixed soon

@gregbell
Copy link
Contributor

This should be closed by aafde51 as referenced in Issue #369

@shapiro2
Copy link

I got this error as well and all I needed to do was to restart the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants