Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 945157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:42:32+00:00 2026-05-15T22:42:32+00:00

I am trying to use acts_as_taggable plugin to include tag functionality in my ruby

  • 0

I am trying to use acts_as_taggable plugin to include tag functionality in my ruby on rails application. I have attached the code. I have installed the plugin and also run the migrations.I am getting the following error.

undefined method `each' for "value of the parameter":String

Code

location.rb – location table has name, tags(this is an additional field I have in the table, I added it before knowing about the plugin :), city fields

class Location < ActiveRecord::Base
  belongs_to :profile
  acts_as_taggable
end

profile.rb

class Profile < ActiveRecord::Base
  has_many :locations
  acts_as_tagger
end

location_controller.rb

def create
  @location = Location.new(params[:location])
  @location.tag_list = ["tags1","tags2"]
  if @location.save
     redirect_to(@location)
  else
     redirect_to(@profile)
  end 
end

Application Trace

/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/associations/association_collection.rb:320:in `replace'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/associations.rb:1331:in `block in collection_accessor_methods'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/base.rb:2906:in `block in assign_attributes'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/base.rb:2902:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/base.rb:2902:in `assign_attributes'
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/base.rb:2775:in `attributes='
/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-2.3.8/lib/active_record/base.rb:2473:in `initialize'
/Users/felix/rails_projects/sample_app/app/controllers/locations_controller.rb:92:in `new'
/Users/felix/rails_projects/sample_app/app/controllers/locations_controller.rb:92:in `create'

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T22:42:33+00:00Added an answer on May 15, 2026 at 10:42 pm

    Are you using Ruby 1.9 by any chance? The rest of this answer is prefaced on a yes. If so read on.

    You may have stumbled over a 1.9 change of behavior. Strings in 1.9 no longer support each (i.e. they are notEnumerable like Ruby 1.8). But you can use each_char which is probably what was intended.

    If this isn’t your code blowing up then you could either:

    • Go back to 1.8.x (Obvious)
    • Hack the String class by adding a method each (Messy and possibly dangerous)
    • Fix the gem or plugin that is causing the trouble.

    There’s a great article on all this here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Rails application I am trying to use the acts_as_taggable_on_steroids plugin but it
I am trying use gem tire to search in my application. I have tables
I'm trying to get tags working in my rails application and want to use
I am trying to use the Whenever plugin for rails to perform a model
I am trying to use the Whenever plugin for rails to perform a model
I am trying to use the Whenever plugin for rails to perform a model
I am trying to use Jcrop for my application, though I have run into
Hi I'm trying use a datepicker on a field I have. I'm trying to
I'm trying to use git push heroku master to upload my rails 3 app
I am looking on trying to use acts_as_paranoid plugin for soft delete of records.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.