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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:45:54+00:00 2026-06-08T08:45:54+00:00

So i am using CSS, JS and Ruby for a project. Now i have

  • 0

So i am using CSS, JS and Ruby for a project. Now i have my location set etc, in ruby but i want to access them on my css files. This is to customize views for a particular locale. I have done the following in my controller.

 before_filter :set_locale

 private

 def set_locale
    @locale ||= params[:locale] || session[:locale] || I18n.default_locale
      I18n.locale = session[:locale] = @locale
 end

How do i access this set location in my CSS files? for instance to say that if location is russia then make the height 200 px or something like that.

  • 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-08T08:45:55+00:00Added an answer on June 8, 2026 at 8:45 am

    You can add current locale to html tag as lang.
    For example

    %html{lang: I18n.locale}
    <html lang="en"> or <html lang="ru">
    

    and add specific language style with language prefix

    html[lang="en"] {
      # for english part
    }
    
    html[lang="ru"] {
      # for russian part
    }
    

    also you can change behavior existing class

    .test-title {
      html[lang="en"] & {
        // specific english style
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on Ruby on rails project for a while now, when
I am new to Ruby, using ruby 1.9.2P180 and Rails 3.1.0.rc2 I have screen.css
I'm navigating a document using CSS selectors with Ruby, but I've found some css-selector
I need to generate default Blueprint CSS files using a Ruby command in the
Using css (not a inline one, but external stylesheet) how do i override the
Little trouble in using css, in the below code, i have used odd and
I'm using css to hide content that I want to reveal when a person
I have been debating using css with div's and laying out elements, and really
I'm writing a Django project that uses the LESS language. I'm using the django-css
I am using bootstrap-sass, formtastic-bootstrap, rails 3.2, and ruby 1.9.3p0 on a new project.

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.