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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:33:20+00:00 2026-06-07T10:33:20+00:00

I am building a multi lingual website, using ruby on rails, where part of

  • 0

I am building a multi lingual website, using ruby on rails, where part of the content is supposed to be user generated and they are supposed to be able to create different versions of it for all languages. The language support is handled by i18n gem.

Part of their content is created using Markdown through http://daringfireball.net/projects/markdown/basics .

In my database I save: object.content_markdown_en, object.content_html_en, object.content_markdown_sv, object.content_html_sv and so on for the different locales.

Now if a user changes the content, new html is supposed to be generated. But it seems unnecessary to regenerate the html for all locales if he only made changes in one of the languages.

I thought there might be some way to use something like

if object.content_markdown_[locale]_changed?
  generate_new_html
end

that can be run in a loop for all possible locales. But I can’t find any nice ways of doing this.

  • 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-07T10:33:22+00:00Added an answer on June 7, 2026 at 10:33 am

    How about:

    [:en, :sv].each do |locale|
        if object.send("content_markdown_#{ locale }_changed?".to_sym)
            send("generate_new_#{ locale }_html".to_sym)
        end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a multi-lingual website using drupal 7. Now, I'm in the process of
So imagine I'm building a Multi User Dungeon system using a MVC web application.
When building a multi-lingual website (with ASP.NET web forms), I'll use an HTTP module
I believe strongly in using unit-tests as part of building large multi-platform applications. We
I'm building a multi-section splash page using jQuery scrollTo to navigate between sections. There's
I am building a website using Asp.net with C# and back end support is
I'm building multi tenant application with shared table structure using Microsoft SQL Server. I
I'm building a multi-step form in rails. It's not javascript driven, so each page
We are building an ASP.Net MVC 2 multi-tenant application on SQL Server using the
i am building a website with a multi-language feature. it would be hard if

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.