Hi,
I am facing this error in my application previously it was working
Rails 5.0.0.1
Ruby 2.3.0
NoMethodError (undefined method `email’ for #Pin:0x007fbec7e1ad60):
def create
@pin = current_user.pins.build(pin_params)
respond_to do |format|
if @pin.save ========> showing error at this line
redirect_to @pin, notice: 'Pin was successfully created.'
# format.json { render :show, status: :created, location: @pin }
else
render :new
# format.json { render json: @pin.errors, status: :unprocessable_entity }
end
end
end
Thnaks in Advance