> On Dec 13, 2015, at 9:11 AM, Naresh Jilla <[email protected]> wrote:
> 
> hi,
> i just create normal form and my form is diplays fine but when i am
> entering values in the field it will shown following error
> 
> ActiveModel::ForbiddenAttributesError
> Extracted source (around line #6):
> 
> 
> 4.end
> 5.def create
> 6.@student = Student.new(params[:student])
> 7.if @student.save
> 8.redirect_to new_student_path
> 9.end
> 
> This is my controller
> 
> class StudentsController < ApplicationController
>   def new
>    @student = Student.new
>  end
>  def create
>    @student = Student.new(params[:student])
>    if @student.save
>      redirect_to new_student_path
>    end
> end
> end

You need a Strong Parameters - compliant params getter method in your 
controller. Have a read here: 
http://guides.rubyonrails.org/action_controller_overview.html#strong-parameters 
for more information.

Walter

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/F57D691B-29CD-4017-8137-7E15A5AF1756%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to