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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:00:02+00:00 2026-05-26T12:00:02+00:00

I am using the ERB engine to generate an offline HTML version of a

  • 0

I am using the ERB engine to generate an offline HTML version of a page of my Rails website. The page shows great when shown by Rails, but I have trouble generating with ERB by myself (despite using the same ERB template).

First I was getting the error undefined method 't' and I solved it by replacing all <%=t(...)%> calls with <%=I18n.translate(...)%>.

Now I get undefined method 'raw'. Should I replace all <%=raw(...)%> calls with something else? If yes, what?

  • 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-26T12:00:03+00:00Added an answer on May 26, 2026 at 12:00 pm

    raw is defined as helper in actionpack/action_view library so that without rails you can’t use it. But ERB templating shows its output without any escaping:

    require 'erb'
    @person_name = "<script>name</script>"
    ERB.new("<%= @person_name %>").result # => "<script>name</script>" 
    

    And because of this for purpose of escaping there is ERB::Util#html_escape method

    include ERB::Util
    ERB.new("<%= h @person_name %>").result # => "&lt;script&gt;name&lt;/script&gt;" 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using rails beta 3 and I have a erb page named index.html.erb
I'm using rails 3. In my index.html.erb and in my index.js.erb, if I have:
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
I have several partials that I'm including in my Rails application.html.erb file , but
I have a rails application using views/layouts/application.html.erb as the default site template. I'm just
I'm building a blog using RoR. I have the index.html.erb page for the posts
I'm using application.html.erb in the views/layouts folder of my Ruby on Rails web app
I have a Javascript where I render a partial using the js.erb : $('#registration-steps').fadeOut(fast).html(<%=
So I'm using an application.html.erb file which is basically the layout for every page
While using Rails ActionMailer with Multipart Emails I created both: approve_trade_email.html.erb AND approve_trade_email.text.erb I

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.