It should be like this
payment_params[:stripe_token] = charge.id
@payment = Payment.new(payment_params)
respond_to do |format|
if @payment.save
And you will have this method private in controller
private
def payment_params
params.require(:payment).permit(:payment, :stripe_token)
end
Please refers rails 4 strong parameter tutorial if you are not aware of it. you can do it with simple. dont worry.
http://blog.sensible.io/2013/08/17/strong-parameters-by-example.html