email ID issue

18 views
Skip to first unread message

Piyush Chowhan

unread,
Aug 14, 2018, 6:09:02 AM8/14/18
to Ruby on Rails: Talk
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

Hassan Schroeder

unread,
Aug 14, 2018, 7:00:49 PM8/14/18
to rubyonrails-talk
On Tue, Aug 14, 2018 at 3:09 AM, Piyush Chowhan
<peyushc...@gmail.com> wrote:

> I am facing this error in my application previously it was working

What did you change between now and "previously"?

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Piyush Chowhan

unread,
Aug 15, 2018, 4:32:42 AM8/15/18
to rubyonra...@googlegroups.com
I guess only just rails version. It was my older app.


--
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.



--
Thanks & Regards
Piyush Chowhan

Hassan Schroeder

unread,
Aug 15, 2018, 11:25:48 AM8/15/18
to rubyonrails-talk
On Wed, Aug 15, 2018 at 1:32 AM, Piyush Chowhan
<peyushc...@gmail.com> wrote:

>> What did you change between now and "previously"?

> I guess only just rails version. It was my older app.

"only just" LOL

Did you upgrade from the last previous major version? If so, did you
fix all the deprecation warnings?

Is this part of your code covered by tests? If not, writing them would
be a good next step...
Reply all
Reply to author
Forward
0 new messages