Controller in subfolder help

Hi guys,
i’ve created a scaffold in an admin folder. the folders are app/
controllers/admin/books_controller and app/views/admin/index, new
etc…
I changed routes.rb to look like this:


map.resources :books

map.namespace :admin do |admin|
admin.resources :books
end

But i am having problems with the actions inside index.hmtl.erb. This
is my view(scaffold):


<% for book in @books %>

<%=h book.title %> <%=h book.description %> <%= link_to 'Show', book %> <%= link_to 'Edit', edit_admin_book_path(book) %> <%= link_to 'Destroy', book, :confirm => 'Are you sure?', :method => :delete %> <% end %> ...

<%= link_to ‘New book’, new_admin_book_path %>

‘New_book’ and ‘Edit’ works but others does not work.When i change in
‘Show’ action the book to admin_book(helper method) i get an error.
What changes do i have to make to the code to make it work??

Thanx in advance
Kostas L.

Hi Kostas L.

Read this thread

http://www.ruby-forum.com/topic/192938

Sijo

Thank u very much Sijo that really helped!! I totally understood what
should i do!

Kostas

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs