Re: [CarrierWave] undefined method `key?' for nil:NilClass

80 views
Skip to first unread message

Jodi Showers

unread,
Mar 13, 2013, 10:36:38 AM3/13/13
to carri...@googlegroups.com
follow standard debugging techniques

comment out the contents of the model - run the console to see what syntax or data relation errors you may have (running reload! in the console will take up your latest edits to the model file)

check your routes - "rake routes" - did you defined a route for the advert controller ?


On Wed, Mar 13, 2013 at 8:25 AM, Dmitrij <d.bor...@gmail.com> wrote:
Hey, guys.

Have next model and controller:

class Advert < ActiveRecord::Base
  attr_accessible :age_id, :breed_id, :castration_id, :chip_id, :color_id, :coloring_id, :ears_id, :email, :first_name, :hair_id, :image, :last_name, :pet_id, :phone, :place_id, :size_id, :tail_id

  belongs_to :age, :breed, :castration, :chip, :color, :coloring, :ears, :pet, :place, :size, :tail, :hair       

end

class AdvertController < ApplicationController
  def create
  end
end

When i run http://localhost:3000/advert/create, show error undefined method `key?' for nil:NilClass. I thnk its problem with model, but cant found error.

--
You received this message because you are subscribed to the Google Groups "carrierwave" group.
To unsubscribe from this group and stop receiving emails from it, send an email to carrierwave...@googlegroups.com.
To post to this group, send email to carri...@googlegroups.com.
Visit this group at http://groups.google.com/group/carrierwave?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jodi Showers

unread,
Mar 13, 2013, 10:47:51 AM3/13/13
to carri...@googlegroups.com
also, the controller should be plural

the model singular
the controller plural

advert.rb
adverts_controller.rb

if you follow these rules the stars will align - if not, there be dragons
Reply all
Reply to author
Forward
0 new messages