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

  • SEARCH
  • Home
  • 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 6650493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:53:58+00:00 2026-05-26T00:53:58+00:00

Im trying to setup a blog with tagging, and i’ve run into a problem

  • 0

Im trying to setup a blog with tagging, and i’ve run into a problem when trying to save.

I got 3 models

blog model

has_many :blog_tags
has_many :tags, :through => :blog_tags

blog_tag model

belongs_to :blog
belongs_to :tag

tag model

[nothing]

When i post my blog form, i got an input field with a comma seperated list of tags that i would like to create in the blog_tags tabel.

I’ve been trying out some different stuff and ended up with this

@blog_tags = params[:blog][:tags].split(",")

@blog_tags.each do |tag|
  @tag = Tag.find_by_tag(tag)
  @blog.tags.push(@tag)
end

Seemed to be working besides it complained that the parent wasn’t created, and in the 2nd try it gave me an error for trying to split the string “string1” which i guess is caused by not having any commas.

I really hope one of you out there can help me out here, or atleast point me in the right direction 🙂

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-26T00:53:59+00:00Added an answer on May 26, 2026 at 12:53 am

    I’d go for a gem. Try https://github.com/mbleigh/acts-as-taggable-on for example.

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

Sidebar

Related Questions

I've got a WordPress powered blog that I'm trying to get setup on our
I'm trying to setup a date lookup table as in this: http://www.techrepublic.com/blog/datacenter/simplify-sql-server-2005-queries-with-a-dates-table/326 but the
I'm trying to modify an existing Django Mezzanine setup to allow me to blog
ref: http://boedesign.com/blog/2008/06/08/imagetick-for-jquery/ I'm trying to get the aformentioned example working in a setup with
I'm trying to setup a jekyll blog on heroku. This is my dir structure
I'm trying to utilize the power of wordpress to set up a blog on
I'm trying setup a subset of boost and get it properly compiled using bjam,
Trying to setup an SSH server on Windows Server 2003. What are some good
Trying to setup a CodeIgniter based project for local development (LAMP stack), and once
After trying to setup my site for Google Webmaster Tools I found that my

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.