Hello!
I'm using restful_authentication and I would like to have diferent views
for logged users and not logged users. Logged users can edit and create
items, and not logged user could only list items and show its features.
In my routes file I have:
map.namespace :admin do |admin|
map.resources :items, :controller => "admin/items", :path_prefix =>
'admin'
end
map.resources :items
In my views I have:
<%= link_to '<b>Items</b>', items_path %>
The link_to always redirect to admin/item/index (except if I change the
order in routes.rb, if I do always redirect to item/index).
Is it possible to redirect admin/item/index when user is logged in and
redirect to item/index when user is not logged in?
Thanks
--
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.
No comments:
Post a Comment