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
NoMethodError (undefined method `service_options' for nil:NilClass)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Nirav  
View profile  
 More options Oct 17 2012, 7:14 am
From: Nirav <nirav.mtech...@gmail.com>
Date: Wed, 17 Oct 2012 04:14:47 -0700 (PDT)
Local: Wed, Oct 17 2012 7:14 am
Subject: NoMethodError (undefined method `service_options' for nil:NilClass)

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):

vendor/extensions/smartmove/app/controllers/quote_requests_controller.rb:13 6:in
`load_regions'
  vendor/radiant/vendor/plugins/haml/rails/./lib/sass/plugin/rails.rb:19:in
`process'

/home/bacancy/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/httpserver.r b:104:in
`service'

/home/bacancy/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/httpserver.r b:65:in
`run'

/home/bacancy/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:17 3:in
`start_thread'

/home/bacancy/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:16 2:in
`start'

/home/bacancy/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:16 2:in
`start_thread'

/home/bacancy/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:95 :in
`start'

/home/bacancy/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:92 :in
`each'

/home/bacancy/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:92 :in
`start'

/home/bacancy/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:23 :in
`start'

/home/bacancy/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/1.8/webrick/server.rb:82 :in
`start'

in
   "vendor/extensions/smartmove/app/controllers/quote_requests_controller.rb"
line no:136 is

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

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
Thank you in advance

Thanking You
Nirav


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

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.
Nirav  
View profile  
 More options Oct 17 2012, 9:14 am
From: Nirav <nirav.mtech...@gmail.com>
Date: Wed, 17 Oct 2012 06:14:49 -0700 (PDT)
Local: Wed, Oct 17 2012 9:14 am
Subject: Re: NoMethodError (undefined method `service_options' for nil:NilClass)

Hi colin,

Thanx for reply

here is no data in service_descriptions table so i got your point but i am
working on existing app but can't get service_options method in file of
quote_request_controller.rb .  can you please give me some area to search
in app. i searched in all included and require files.

Thanking You,
Nirav  


 
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.
Colin Law  
View profile  
 More options Oct 17 2012, 9:35 am
From: Colin Law <clan...@googlemail.com>
Date: Wed, 17 Oct 2012 14:34:16 +0100
Local: Wed, Oct 17 2012 9:34 am
Subject: Re: [Rails] Re: NoMethodError (undefined method `service_options' for nil:NilClass)
On 17 October 2012 14:14, Nirav <nirav.mtech...@gmail.com> wrote:

> Hi colin,

> Thanx for reply

> here is no data in service_descriptions table so i got your point but i am
> working on existing app but can't get service_options method in file of
> quote_request_controller.rb .  can you please give me some area to search in
> app. i searched in all included and require files.

Sorry, I do not understand your question.  If you are still referring
to your original problem it is not that service_options does not exist
but that the object you are trying to call it on is nil.

How are you getting on working through the tutorial I suggested?

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.
Nirav  
View profile  
 More options Oct 17 2012, 10:00 am
From: Nirav <nirav.mtech...@gmail.com>
Date: Wed, 17 Oct 2012 07:00:32 -0700 (PDT)
Local: Wed, Oct 17 2012 10:00 am
Subject: Re: [Rails] Re: NoMethodError (undefined method `service_options' for nil:NilClass)

Hi Colin,

Thanks for  reply,

I have gone through your post. but i add dummy data in my
service_descriptions table but it will be error in it. App didn't get
service_options so i can't locate service_options. i searched in
controllers or helper methods which is related to
quote_requested_controller.rb

i am reading tutorial that suggested by you. but i have to solve it ASAP.
so that's why i raise a query.

Thanking You,
Nirav


 
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.
Colin Law  
View profile  
 More options Oct 17 2012, 10:13 am
From: Colin Law <clan...@googlemail.com>
Date: Wed, 17 Oct 2012 15:12:15 +0100
Local: Wed, Oct 17 2012 10:12 am
Subject: Re: [Rails] Re: NoMethodError (undefined method `service_options' for nil:NilClass)
On 17 October 2012 15:00, Nirav <nirav.mtech...@gmail.com> wrote:

> Hi Colin,

> Thanks for  reply,

> I have gone through your post. but i add dummy data in my
> service_descriptions table but it will be error in it. App didn't get
> service_options so i can't locate service_options. i searched in controllers
> or helper methods which is related to quote_requested_controller.rb

> i am reading tutorial that suggested by you. but i have to solve it ASAP. so
> that's why i raise a query.

Is there a service_options table?
If you look in model/service_description.rb do you see
has_many :service_options
If so then that means the two tables are related by a has_many
belongs_to relationship.  See the Rails Guide on ActiveRecord
Associations for more details.

Really you have no way of getting it going without increasing your
basic knowledge level first.  Take three days out and work right
through the tutorial then you will have a much better chance.

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.
Nirav  
View profile  
 More options Oct 17 2012, 10:43 am
From: Nirav <nirav.mtech...@gmail.com>
Date: Wed, 17 Oct 2012 07:43:25 -0700 (PDT)
Local: Wed, Oct 17 2012 10:43 am
Subject: Re: [Rails] Re: NoMethodError (undefined method `service_options' for nil:NilClass)

Hi Colin,

Thanks for your valuable comment,

I really need more work on it. yes. there is a table service_options.

in file that you have explained in previous comment

class ServiceDescription < ActiveRecord::Base
  has_many :services, :through => :service_options
  has_many :service_options

  validates_presence_of :name
end

so that's i mailed to client to give full detail of his all database with
data.

Thanks again colin for show me the right path

Thanking You
Nirav


 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »