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 7884181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:43:47+00:00 2026-06-03T04:43:47+00:00

I am new to rails development and I am trying to get the auto_html

  • 0

I am new to rails development and I am trying to get the auto_html gem to work, but nothing ever gets saved to the body_html field of the DB. I am not getting any errors either, so it seems like the gem just isn’t getting called.

I have included the gem in my gemfile and ran bundle install. Am I not doing something correctly? My thought was that I didn’t need to call any auto_html method anywhere because I have the auto_html_for in the model.

I am on Rails 3.2.1 and ruby 1.9.3p125 and auto_html 1.5.1

Model:

class Video < ActiveRecord::Base
  belongs_to :campaign

  auto_html_for :body do
    html_escape
    image
    youtube(:width => 400, :height => 250)
    link :target => "_blank", :rel => "nofollow"
    simple_format
  end
end 

Controller:

class VideosController < ApplicationController

  def new
    @video = Video.new

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @video }
    end
  end

  def create
    @video = Video.new(params[:video])

    respond_to do |format|
      if @video.save
        format.html { redirect_to videos_path(:campaign => "#{@video.campaign_id}"), notice: 'Video was successfully created.' }
        format.json { render json: @video, status: :created, location: @video }
      else
        format.html { render action: "new" }
        format.json { render json: @video.errors, status: :unprocessable_entity }
      end
    end
  end

View:

= simple_form_for @video do |f|

  .field
    = f.hidden_field :campaign_id, :value => "#{params[:campaign]}"

    = f.text_area :body
  .actions
    = f.submit 'Save'

EDIT: videos table definition from schema.rb

create_table "videos", :force => true do |t|
    t.text     "body"
    t.text     "body_html"
    t.integer  "campaign_id"
    t.datetime "created_at",  :null => false
    t.datetime "updated_at",  :null => false
  end
  • 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-06-03T04:43:49+00:00Added an answer on June 3, 2026 at 4:43 am

    auto_html_for didn’t worked well with Rails 3.2.1+

    Install the latest auto_html version (1.5.2).

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

Sidebar

Related Questions

I am trying to install the new version of the twitter-bootstrap-rails gem (v2), but
I'm new to Rails (and web development [but not new to Ruby]) and still
I'm trying to set up a rails 3.2 app with the new compass-rails gem
I'm trying to get into Rails development and am using Aptana Studio (RadRails) as
I'm new to Rails and web development in general. I'm trying to better understand
I am trying to get PayPal Gateway to work on a rails 3 app.
I'm new to Rails development, and I'm trying to figure out how to use
Trying to get fragment caching to work in Rails 3.0.9. I have set this
I'm trying to get a brand new skeleton app running in rails 3.1.0.rc8. However,
At my new job I am doing rails development and I am on Ubuntu

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.