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

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 Visit http://somesite.com/his_name .

Second, you get your routes.rb

  "/: username" = & gt; "User # User_Place"   

Again, I assume that you have all the following classes in your users_controller.rb , here's the code: for the end of your other categories

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -