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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:42:06+00:00 2026-05-20T09:42:06+00:00

I have this in my view but I would like to clean it up

  • 0

I have this in my view but I would like to clean it up and put it all inside a method in a helper.

I know how to put div and some content inside a content_tag. However how do I pass the partial?

 <% if show_content?(flash[:invitation]) %>
       <div id="invite_box">
       <%= render :partial => 'user/invite', :locals => {:user => @user } %>
       </div>
       <% elsif show_content?(flash[:confirmation]) %>
       <%= render :partial => 'user/invite_confirmation' %>
       <% 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-05-20T09:42:06+00:00Added an answer on May 20, 2026 at 9:42 am

    If the invite partial should always be wrapped in an invite_box div, it would make sense to just put that div inside the partial.

    However, you can do this in your helper:

    def show_invite_info
      if show_content?(flash[:invitation])
        content_tag(:div, :id => "invite_box") do
          render :partial => "user/invite", :locals => {:user => @user}
        end
      elsif show_content?(flash[:confirmation])
        render :partial => "user/invite_confirmation"
      end
    end
    

    Then in your view just do:

    <%= show_invite_info %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to implement this view But I have one question: The text which
Im create this code to store page view in database, but i have problem
I have this code in a prepareForSegue method // Get destination view UIViewController *viewController
I would like to know how to embed my div tag, which I want
I would like to get some opinions on when/if it is ok to put
I have this Haml view: !!! strict %html{:xmlns => http://www.w3.org/1999/xhtml} %head %meta{:content => text/html;
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'
I have this in my partial view: <tr> <% for (int currentDay = 0;
I have this code in my view: echo form_label('State', 'state'); $options = array( 'No
I have this attribute in my view model: [CustomRequired, EmailRegex] [Display(Name = KeepInformedPersonMail, ResourceType

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.