similar to: ActiveModel: undefined method `attributes`

Displaying 20 results from an estimated 40000 matches similar to: "ActiveModel: undefined method `attributes`"

2012 Sep 03
0
undefined method `singular_route_key' for "User":ActiveModel::Name
In ActionDispatch::PolymorphicRoutes, there is a call to build_named_route_call an on line 172 (of latest rails code from github), there is a call to singular_route_key: model_name_from_record_or_class(parent).singular_route_key Now model_name_from_record_or_class returns an ActiveModel::Name object, which is a wrapper to the string class, that returns a string name of the class of an
2011 May 19
0
NoMethodError (undefined method `serializable_record' for #<ActiveModel
Hi , Am using rails 3 .I have added code in my controller ----------------------------------------------------------------------- la.map{|c| ActiveRecord::Base::Serializer.new(c).serializable_record ----------------------------------------------------------------------- But am getting below error ------------------------------------------------------------ NoMethodError (undefined method
2014 Apr 06
0
undefined local variable or method `message' (NameError)
I am trying to learn Rspec-Cucumber tutorial by referring to "The Pragmatic Programmers - The Rspec Book". I am on the 4th chapter and seems to be stuck with an error and not able to move forward.I have followed exactly as per the tutorial but it is showing the below error `( in line : output.messages.should include(message))`when I try to run cucumber feature in my console. **undefined
2010 Sep 03
1
Action Controller Error: undefined local variable or method `current_user'
Newbie learning Rails. I''m currently on Chp9 here: http://railstutorial.org/chapters/sign-in-sign-out#top At the end of the tutorial, rails is erroring (see below). being new to Rails and after having checked the tutorial... How do you resolve this kind of error. It''s saying current_user is not defined, and it is supposed to be defined with/Sites/sample_app/app/helpers/
2013 Jun 23
1
Contact form - NoMethodError (undefined method `each' for nil:NilClass)
Hi Guys, So basically I want a contact form to appear on all the service pages. I''ve already created a contact form for the contact page which works perfectly using this tutorial: http://matharvard.ca/posts/2011/aug/22/contact-form-in-rails-3/ Now I would like to implement this approach on the service pages, and it works until I push the Submit button, when I get the following error:
2011 Aug 20
2
[Linux] Error installing rails "activemodel requires activesupport"?
Well, I''m trying to install Rails through gems in a Linux box `sudo gem i rails --pre` I''m getting this: ERROR: Error installing rails: activemodel requires activesupport (= 3.1.0.rc6, runtime) Which is funny, because when I check `gem list` I get activesupport (3.1.0.rc6) bcrypt-ruby (2.1.4) builder (3.0.0) i18n (0.6.0) multi_json (1.0.3) I don''t know what to
2012 Jul 21
0
undefined method `scope' for non ActiveRecord class
I am trying to use the geocoding capabilities into a table less model , but the method :scope is not defined .. is there a way to include it ? class SearchLocation require ''geocoder'' include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming extend Geocoder::Model::ActiveRecord # extending the class w geocoding capaibilities ( from
2010 May 27
1
Question on Rails 3 : forms && ORM && ActiveModel
I''m a Django/Catalyst user that''s evaluating Rails ... I need a Ruby framework, and I''m trying to see if learning Rails is worth it or I should just go for Sinatra + various libs available. Django has a couple of things I like ... 1) the Forms API In Django I like that it''s being decoupled from models ... form objects have fields with validation rules that
2010 Aug 13
2
Rails 3 / ActiveModel for Credit Card information?
When submitting billing information in the past I''ve always used attr_accessor for credit card details as they should not be saved in the database. In addition I always end up storing the card expiration date so that the date form helper works correctly. With Active Model it seems logical to create a CreditCard class to hold this data instead. **1st issue.** It seems there still
2010 Sep 17
0
Key Value Json ActiveModel::Errors
Hi all, I''m using Rails 3.0, and I have a model which validates if the attribute :name is present. On my my views, I use Jquery to submit the form which creates the model. If the name is not present, Rails returns something like this Json: [''Name is a required value''] Is there a way to make it return something like this? [''name'': ''Name is a
2010 Dec 24
0
keep getting "undefined method `map' for nil:NilClass (NoMethodError) " in new server
hi guys, I have a new development server (ubuntu 10). I have done the following (the versions match my existing development machine which works fine): 1. installed ruby 1.9.1p378 2. installed ruby gems 1.3.7 3. installed rails 2.3.8 (used "gem install rails -v 2.3.8") 4. manually installed my other gems including sphinx and thinking sphinx with "gem install ..." 5. ran
2013 Jul 21
4
how to use activemodel collection.build for a has_many :through association
Hi all, In my controller I am doing the following to populate a nested form for a has_many through association: def new @specification = Specification.new Component.find_each.each do |component| @specification.component_specifications.build(:component_id => component.id) end The idea being whenever someone creates or edits a form, it will be populated with all
2012 Sep 18
2
undefined method `to_sym' for nil:NilClass
Hi all, I am trying to upgrade my rails 2 app to 3 and am getting this error when trying to login: NoMethodError in AuthenticateController#authenticate undefined method `to_sym'' for nil:NilClass The stack trace is: activerecord (3.2.2) lib/active_record/validations/uniqueness.rb:26:in `validate_each'' activemodel (3.2.2) lib/active_model/validator.rb:153:in
2012 Aug 05
0
ActiveRecord::Validator vs ActiveModel::Validator
I know that there is an ActiveModel Validator class https://github.com/rails/rails/blob/master/activemodel/lib/active_model/validator.rb which is used for the class level validation macros. But I didn''t find a an ActiveRecord Validator class. From my understanding in Rails 3, validations have been moved into ActiveModel to leave ActiveRecord as an ORM. So now I see this Rails 3 code
2010 Oct 21
4
Authlogic + Rails3 - undefined method `Login' for nil:NilClass
Im new to Rails, and decided to start of with Rails3. After a lot of searching ive managed to get a little bit of Authlogic working. I''m able to register a user, login & logout. Now, I would like to add more features, get more of authlogic working. I''m using Railscast EP 160 as my reference. Portions of the code found on the tutorial throw errors: Eg: <!--
2013 Feb 27
0
Exended modules and reject_if in nested_attributes
I have some common class methods in a module ''active_record_additions'' that I load into a class by Activity by using extend ActiveRecordAdditions The Activity class uses nested_attributes_for with a reject_if method saved in the module ''active_record_additions'' The problem is that the class methods in ''active_record_additions'' works when I
2014 Apr 14
0
Foundation & Authlogic
Seems I can get either Foundation or Authlogic to work but not both - After bundle install when I do a rails g foundation:install I get the following: C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.0/lib/acti ve_record/dynamic_matchers.rb:26:in `method_missing': undefined local variable o r method `inheritable_attributes' for ActiveRecord::Base:Class (NameError)
2010 Aug 22
7
Rails 3: Error saving an object with no useful information
Hey, I''m kinda desperate cause I''m getting an error and have no idea how to fix this since it doesn''t give me any information hinting where the problem is: irb(main):054:0> reload!;User.last.save! Reloading... NameError: undefined local variable or method `to_ary'' for #<User:0x4ed5d20> from
2010 Sep 05
13
undefined method `path' for Gem:Module (NoMethodError)
Hi, when running - ''ruby setup.rb'' I get the following error message: C:\rubygems-1.3.7>ruby setup.rb C:/rubygems-1.3.7/lib/rubygems/source_index.rb:68:in installed_spec_directories'': undefined method `path'' for Gem:Module (NoMethodError) Ruby version is ruby-1.9.2-p0. Any idea ? Thanks. Dani -- Posted via http://www.ruby-forum.com/. -- You received
2011 Jun 12
3
Problem with undefined variable current_user
Hi everyone, I''m working through the tutorial at the following link and attempting to customise/adapt the lessons for my own slightly different application. Link: Ruby on Rails Tutorial: Learn Rails by Example | Ruby on Rails 3 Tutorial book and screencasts | by Michael Hartl <http://ruby.railstutorial.org/ruby-on-rails-tutorial-book> I''m currently trying to work