0

Rails 4 では、.JS ビューで Ruby コードを使用できますか? Rails 3 では、ファイル名に .erb.js を含める必要がありました

  def test
    respond_to do |format|
      format.js { Rails.logger.info "in JS handler" }
    end
  end



/app/views/users/test.erb.js <== no longer works in rails 4

/app/views/users/test.js <== still works in rails 4 but does it allow ruby inside this file?
4

2 に答える 2