Ruby on Rails
Friday, March 2, 2012
Hi all. I have a route file like this:
Deals::Application.routes.draw doroot to: "Main#home"resources :vendors doresources :offersendmatch '/admin' => 'Admin::Pages#index'namespace :admin domatch '/login', to: 'Sessions#new'resources :offers, :vendorsresources :sessions, only: [:new, :create, :destroy]endend
First of all I would like to know if the way I declared the namespace and the matching rules inside it are ok.
Next, I want the visitors of the app (front-end) to be able only to view the :offers and :vendor resources (index & show actions). I only want to allow admins (app.com/admin/blabla) which are the logged users, to be able to manage these resources (edit, add, delete etc). How could I implement this?
Should I do it like this? http://pastie.org/3503560 Or could I just leave it as is and not implement the actions in the public controllers?
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/at3tjXHWWeAJ.
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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment