Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion NoMethodError (undefined method `service_options' for nil:NilClass)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Colin Law  
View profile  
 More options Oct 17 2012, 7:24 am
From: Colin Law <clan...@googlemail.com>
Date: Wed, 17 Oct 2012 12:23:39 +0100
Local: Wed, Oct 17 2012 7:23 am
Subject: Re: [Rails] NoMethodError (undefined method `service_options' for nil:NilClass)
On 17 October 2012 12:14, Nirav <nirav.mtech...@gmail.com> wrote:

> hi i am using rails 2.3.4 and i am facing "no method error"

> there is possibility to not find method but my question is - is there
> possibility to error occurred because of empty table? or error in another
> controller or helper?

> error trace:

> Processing QuoteRequestsController#create (for 127.0.0.1 at 2012-10-17
> 16:07:34) [POST]
>   Parameters: {"controller"=>"quote_requests",
> "quote_request"=>{"packing_required"=>"", "move_steps_number"=>"",
> "phone_day"=>"", "pickup_region_id"=>"", "email"=>"", "move_to_street"=>"",
> "move_from_suburb"=>"", "title"=>"", "quick_estimate"=>"true",
> "room_counts"=>{"9"=>"0", "8"=>"0", "5"=>"0", "2"=>"0", "3"=>"0", "6"=>"0",
> "7"=>"0", "1"=>"0", "4"=>"", "11"=>"0"}, "arrive_parking_notes"=>"",
> "first_name"=>"", "arrive_date_flexible"=>"false", "insurance_value"=>"",
> "arrive_steps_number"=>"", "move_parking_notes"=>"", "last_name"=>"",
> "move_region_id"=>"", "move_date_flexible"=>"false", "move_type_id"=>"26",
> "move_to_city"=>"", "arrive_date"=>"", "move_from_street"=>"",
> "move_date"=>"", "move_to_suburb"=>"", "move_from_city"=>"",
> "phone_mobile"=>""},
> "authenticity_token"=>"U42qF1c0FJXvnC1SCNNYWzxKN3Pem7dC6L01LbTQD7E=",
> "commit"=>"Submit", "action"=>"create"}

> NoMethodError (undefined method `service_options' for nil:NilClass):

The important bit of this message is the bit about nil.  You have
tried to call a method service_options on something that is nil.

> vendor/extensions/smartmove/app/controllers/quote_requests_controller.rb:13 6:in
> `load_regions'
> .....
> in
> "vendor/extensions/smartmove/app/controllers/quote_requests_controller.rb"
> line no:136 is

> @regions = ServiceDescription.find_by_name('region').service_options

So ServiceDescription.find_by_name('region') is nil, so probably there
is no record in the service_descriptions database with that name.

> in my database  table is there service_descriptions and service_options. is
> there related to mysql or controller?
> please guide me i am very much confuse. this is existing application i have
> to configure in local as well as on server

I guess that you are a beginner in Rails to be confused by this error.
 I suggest you work through some tutorials on Rails in order to
understand the basic principles.  A few days doing that will save you
a lot of time in the long run.  railstutorial.org is good and is free
to use online.  Make sure that you install the version of rails that
the tutorial expects.

Colin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.