Ruby on Rails Monday, November 28, 2011

On 28 November 2011 15:52, Derrick Bailey <lists@ruby-forum.com> 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

If you make this
resource :licenses do
member do
get 'csv_import'
end
end

That will add the action csv_import as a GET operation to the routes.
It may well be that you don't want it to be a GET however, but that is
a different issue.

See the Rails Guide on routing for more information.

Colin

--
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