我有以下代码行,但不知道为什么我收到错误“ActionController::ParameterMissing in LeaguesController#create param not found:league_name”:
class LeaguesController < ApplicationController
def new
@league = League.new
end
def create
@league = League.new(league_params)
if @league.save
redirect_to payments_new_url
else
render 'new'
end
end
private
def league_params
params.require(:league_name).permit(:league_url)
end
end