I have albums
and pictures
where albums hasmany pictures
This is my routes.rb
resources :albums do
resources :photos
end
Instead of photos_path
my path is album_photos_path
In my photos/new.html.erb
I'm getting this error:
undefined method photos_path' for #<#<Class:0x5232b40>:0x3cd55a0>
How I can do to instead of photos_path
simple form write 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 %>
new
action from the controller? – Chancre