Я получаю эту ошибку:Ошибка: Отсутствует повозки шаблон/уничтожить,
Missing template carts/destroy, application/destroy with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder, :coffee]}.
У меня есть этот код в cart_controller:
def destroy
@cart = Cart.find(params[:id])
@cart.destroy
session[:cart_id] = nil
respond_to do |format|
format.html { redirect_to(store_url, :notice => 'Your cart is
currently empty') }
format.xml { head :ok }
end
end
в app_controller:
private
def current_cart
Cart.find(session[:cart_id])
rescue ActiveRecord::RecordNotFound
cart = Cart.create
session[:cart_id] = cart.id
cart
end
в виду:
<%= button_to 'Empty cart', @cart, :method => :delete, :confirm => 'Are you sure?' %>
У меня есть метод destroy, чтобы выполнить действие, но ошибка выше. В чем проблема?
Есть ли у вас какие-либо фильтры в вашем контроллере? – Icicle