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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:51:37+00:00 2026-06-01T13:51:37+00:00

I am using the Globalize 3 gem as seen in Ryan Bates railscasts, and

  • 0

I am using the Globalize 3 gem as seen in Ryan Bates railscasts, and everything works fine. I need to know how to seed the data though. Currently, I created a table called monthly_post_translations with the following schema

schema.rb

create_table "monthly_post_translations", :force => true do |t|
  t.integer  "monthly_post_id"
  t.string   "locale"
  t.text     "body"
  t.datetime "created_at"
  t.datetime "updated_at"
end

I need to add seed data to this table, but it doesn’t have a model to interact with, so how do I do it?

Here is my currents seeds.rb that isn’t working

seeds.rb

# Monthly Posts
  MonthlyPost.delete_all

 monthlypost = MonthlyPost.create(:body => "Monthly Post Text")


#Monthly Posts Spanish Translation
monthlytranslation = MonthlyPostTranslation.create(:body => "Spanish Translation of monthly post text",
      :monthly_post_id => monthlypost.id,
      :locale => "es" )

But the monthly_post_translation table doesn’t have a model that I can interact with, so I get the error

uninitialized constant MonthlyPostTranslation

Any thoughts on how I can add this seed data properly?

  • 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-01T13:51:39+00:00Added an answer on June 1, 2026 at 1:51 pm

    As from documentation by typing translates :<attribute_name_here> you get generated model named MonthlyPost::Translation. So the answer will be: use instance collection to create or list all translations for entity:

    monthlypost = MonthlyPost.create(:body => "Monthly Post Text")
    
    
    #Monthly Posts Spanish Translation
    monthlytranslation = monthlypost.translations.create(:body => "Spanish Translation of monthly post text",
          :locale => "es" )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using C#, I need a class called User that has a username, password, active
I,m using Globalize2. I'd like to populate DB with db:seed for different locales: en,
In IE 8 I am using YUI to display a Table of data fetched
using VB.Net2010 I need to call a C# DLL The problem I have is
So far I'm using Globalize for i18n and l10n of my JavaScript apps (built
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Linq; using System.ServiceProcess;
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.

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.