In my app I have a view called profiles. On this view the user can update your albums and the photos of those albums.
A User has many Albums. And a Album has many Photos.
Im creating a form inside my profile view to save a album. Like this:
#routes.rb
get '/profile/edit/profile_albums', to: 'profiles#edit_profile_albums'
#/view/profile/edit/profile_albums.html.erb
<%= form_for album do |f| %>
<div class="dialog dialog-centered" id=<%= album.id %> style="display: block;">
<div class="dialog-container dialog-wide">
<div class="dialog-content panel">
<div class="form-group bottom-7">
<label for="">Album Name</label>
<input type="text" id="" value=<%= album.name %> placeholder="Add Album Name">
</div>
<div class="edit-photo-album bottom-5">
<% album.photos.each do |photo| %>
<span class="edit-photo">
<img src="<%= asset_path ix_refile_image_url(photo, :media, fit: 'fill', bg: '0fff') %>" class="photo-preview">
<a href="" title="Remove" class="remove-item">Remove</a>
</span>
<% end %>
<span class="btn btn-default btn-file">
<i ></i> Upload Photos
<%= f.attachment_field :photos_media, multiple: true, direct: true, presigned: true %>
</span>
</div><!-- end photo album -->
<p>
<div class="actions">
<%= f.submit 'Save Album', class: 'btn btn-lg btn-solid-red btn-margin-right' %>
</div>
<button type="button" class="btn btn-lg btn-outline-green dialog-close">Cancel</button>
</p>
</div><!-- end dialog content -->
</div><!-- end dialog container -->
</div>
<% end %>
When I pressing the button save:
<%= f.submit 'Save Album', class: 'btn btn-lg btn-solid-red btn-margin-right' %>
I get this message:
Routing Error
No route matches [PATCH] "/profile/edit/albums"
Someone can help me?
Thanks
'/profile/edit/profile_albums', and not'/profile/:id/edit/profile_albums'?