I have albums and pictures , where albums hasmany pictures
These are my .rb routes
resources :albums do resources :photos end
Instead of photos_path my path is album_photos_path In my photos/new.html.erb I get this error:
undefined method photos_path' for #<#<Class:0x5232b40>:0x3cd55a0>
How can I make a simple form write album_photos_path instead of album_photos_path ?
My new.html.erb
<%= simple_form_for([@album, @photo]) do |f| %> <%= f.error_notification %> <div class="form-inputs"> <%= f.input :title %> <%= f.input :description %> </div> <div class="form-actions"> <%= f.button :submit %> </div> <% end %>
ruby-on-rails ruby-on-rails-4 simple-form
Igor Martins
source share