Внутри действия show Я пытаюсь установить ссылку на действие редактирования контроллера альбома, но я продолжаю получать сообщение об ошибке ActiveRecord: не удалось найти альбом с идентификатором 'id' =: id [ ГДЕ "альбомы" "user_id" =]ActiveRecord :: RecordNotFound в AlbumsController # edit
контроллер Альбом:.?
def edit
@album = current_user.albums.find(params[:id])
end
def update
@album = current_user.albums.find(params[:id])
if @album.update(album_params)
redirect_to '/albums/:id'
else
render '/albums/edit'
end
end
def show
@album = current_user.albums.find(params[:id])
@photos = @album.photos
@interests = current_user.interests
end
Вид:
<% if @album.description.nil? %>
<div class="description" id="new"><%= link_to 'Add Description', "/albums/:id/edit", :style => "text-decoration:none;" %></div>
<% else %>
<div class="description"><%= @album.description %></div>
<% end %>