Routes in Rails 4 -
I want to put a question about routing in rail. The 'user' model with roles is: user.restaurant_owner? And user.shop_owner ?. Besides the user is the only admin, besides there is a super user (this is me). I want the user input Please, give me some suggestions, thank you. Update: The owner can see only in his place, with the model 'owner_id', model restaurants, shops etc. First, because the owner can only see his place, thus only logged in user Second, you get your Again, I assume that you have all the following classes in your 'http://somesite.com/his_name' to be processed according to their role and name on the requesting 'restaurant' or 'shops'. For example, she looks "with" and "the", because 'Stanley' restaurant owner '5' with ID; If he sees the "and he", because 'Marilin is the shop owner with' 101 'id. I want to do this, because I want to show user friendly url, but my system is very big and There are 10 categories (restaurants, cafes, shops, etc.). There are different layouts and actions for the admin panel in each category
Visit http://somesite.com/his_name .
routes.rb
"/: username" = & gt; "User # User_Place"
users_controller.rb , here's the code: for the end of your other categories
Comments
Post a Comment