如果没有需要remote form的response怎么处理呢?
错误是
ActionView::MissingTemplate (Missing template carts/search_book_by_sn, application/search_book_by_sn with {:locale=>[:en], :formats=>[:js, :html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched in:
我的控制器中的代码。因为
如果 session[:loaded_books].include? @book.id
是错误结果的条件,所以我不想执行任何 Javascript。只要保持与原产地相同
respond_to do |format|
# format.js
if session[:loaded_books].include? @book.id
format.js
else
ap("Add into Array")
session[:loaded_books] << @book.id
ap(session[:loaded_books])
format.js { render :action => 'add_to_cart'}
end
end
提前致谢