Ruby on Rails Monday, November 28, 2011

On Nov 28, 2011, at 10:52 AM, Derrick Bailey wrote:

> Relatively new to Ruby on Rails, i'm currently getting this routing
> error I get after going to:- http://localhost:3000/licenses :-
>
> No route matches {:controller=>"licenses", :action=>"csv_import"}
>
> My current routes.rb file:-
>
> Inventory::Application.routes.draw do
> root :to => "home#index"
>
> ActiveAdmin.routes(self)
>
> devise_for :admin_users, ActiveAdmin::Devise.config
>
> resources :licenses
> end
>

Try this:

resources :licenses do
collection do
post 'csv_import'
end
end

That's off the top of my head, but it should help. resources :licenses just gets you the 7 RESTful actions, anything else you need to add yourself, or use a wildcard map (haven't seen one of those in quite a while).

Walter

> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment