I apologise for the question but I am new in RoR.

Basically I have a hotel model which has_many rooms.

I created a manager controller for administration (im redirected to it
after sucessful login)
I also created the "index" and "managing" views in the manager's View.

My managers controller has for methods "index", showing all hotels and
"managing", for showing a specific hotel using `
@hotel=Hotel.find(params[:id])`
The goal is to list all the hotels and in front of every hotel, have a
link that goes to the "managing.html.erb" view with the selected hotel
inside.

Inside it, among others, I would like it to have a menu with several
options, one of them being "Add Room".

I searched and I think im looking at nested resources.

However, since I dont have a manager model (only the controller and
views), it it possible for me to create a link from de managers/index to
the "/managers/managing.html.erb" which would be something like
":3000/managing/1", 1 being the hotel?

How about ":3000/managing/1/room/new"? or ":3000/managing/1/room/1"?

Also, what would the link_to in my managers/index.html.erb would look
like?
(link_to "Click to Manage this hotel", ?? )

Thank you in advance, I appreciate any tips, is this the right way of
doing things? I'm kind of confused...

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to