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
--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAkDHk7vP7KrZYSPLt%2BAWtEYB6w8OoZ%2B4miMG-UHozNnw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.