私は基本的に、ロジックのために別のjsファイルの内容を返す必要があるアクションを持っています。どうすればこれを行うことができますか?ありがとう
app/controllers/classrooms_controller.rb
def create
if params[:test_logic]
respond_to do |format|
format.js { render 'create_differently' } # This doesn't work.
end
else
redirect_to root_path
end
end
app/views/classrooms/create_differently.js.erb
alert('hi')