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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:11:02+00:00 2026-05-30T06:11:02+00:00

Im using the following code within a method called a_level: if(@program.theme==MyHelper::TemplateConstants::DEFAULT_LAYOUT) style = ‘border:

  • 0

Im using the following code within a method called a_level:

if(@program.theme==MyHelper::TemplateConstants::DEFAULT_LAYOUT)
  style = 'border: none'
elsif(@program.theme == MyHelper::TemplateConstants::LOGO_LAYOUT)
  style = 'border: top'
end

And the following within a method called b_level:

if(@program.theme==MyHelper::TemplateConstants::DEFAULT_LAYOUT)
  style = 'color: #888;'
elsif(@program.theme == MyHelper::TemplateConstants::LOGO_LAYOUT)
  style = 'color: #666;'

in the same helper. I want to use a hash instead, something like

my_styles = { :level_a => {... }, :level_b => {...} }

Im not getting it right.
Any help is appreciated!

  • 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-30T06:11:04+00:00Added an answer on May 30, 2026 at 6:11 am

    I think you’re looking for this:

    style_hash = {
        :program_logo => {
            UserMailerHelper::EmailTemplateConstants::DEFAULT_WITH_BANNER => 'border: none;height:50px;float:left; margin-right: 10px; padding: 2px;',
            UserMailerHelper::EmailTemplateConstants::LOGO_AT_BOTTOM => 'border: none;height:80px; padding: 2px 0px 2px 2px;'
        },
        :do_not_reply => {
            UserMailerHelper::EmailTemplateConstants::DEFAULT_WITH_BANNER => 'color: #888; padding-top: 5px; display:block; text-align:center',
            UserMailerHelper::EmailTemplateConstants::LOGO_AT_BOTTOM => 'color: #888; padding-top: 5px; border-top: 1px solid #D7D4C6;'
        }
    }
    

    and then in program_logo:

    style = style_hash[:program_logo][@program.email_theme]
    

    and in do_not_reply:

    style = style_hash[:do_not_reply][@program.email_theme]
    

    Or perhaps it would make more sense to arrange your style_hash like this:

    style_hash = {
        UserMailerHelper::EmailTemplateConstants::DEFAULT_WITH_BANNER => {
            :program_logo => 'border: none;height:50px;float:left; margin-right: 10px; padding: 2px;',
            :do_not_reply => 'color: #888; padding-top: 5px; display:block; text-align:center'
        },
        UserMailerHelper::EmailTemplateConstants::LOGO_AT_BOTTOM => {
            :program_logo => 'border: none;height:80px; padding: 2px 0px 2px 2px;',
            :do_not_reply => 'color: #888; padding-top: 5px; border-top: 1px solid #D7D4C6;'
        }
    }
    

    And then access it like this:

    # program_logo
    style = style_hash[@program.email_theme][:program_logo]
    # do_not_reply
    style = style_hash[@program.email_theme][:do_not_reply]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code within the JCProperty class to retrieve data from a
I'm using the following code within a VB 6.0 application to allow give the
I'm using the following code within XCode, building for iOS with ARC enabled. Why
I'm using the following code (System.Data.SQLite within VB.net): Dim SQLconnect As New SQLite.SQLiteConnection() Dim
I'm using following code to call Method B after N seconds method A is
Using following code I try to get updated list of checkbuttons' corresponding text values,
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
I am using following code in rowdatabound function. Protected Sub gvwMileStone_RowDataBound(ByVal sender As System.Object,
I am using following code to check whether a check box on my website
I am using following code to design my home page. The output (as shown

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.