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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:49:17+00:00 2026-05-27T17:49:17+00:00

I have an HTML file (index.html) in the public folder. These HTML has some

  • 0

I have an HTML file (index.html) in the public folder.
These HTML has some “hooks” in it.
Like:

<div>{client_ssnumber}</div>
<div>{client_company}</div>

I have to retrieve this file and complete the information in the hooks using data obtained in a controller´s method, then display in the screen.

What is the rails way to do it?

  • 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-27T17:49:18+00:00Added an answer on May 27, 2026 at 5:49 pm

    You can’t do this (without terrible terrible hacking), it’s hard coded to look for public files before checking the router.

    Anyway, Your client is wrong. Tell them to use “<%= … %>” instead of “{ … }” and move it into a view (you should move it into the view, so it’s where you want it to be, then just tell them what the name of the file is).

    There is no sensible reason to make up your own templating language. It will be buggier and slower, and it will add a lot of time to get the product out the door. Plus you’ll then have to maintain that code. This is a solved problem, use ERB. If they really like that syntax, use Mustache which is pretty similar, and is an existing templating language.

    If you can’t get them to do this, you have much bigger problems than how to render this page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Absolute beginner question: I have a template file index.html that looks like this: ...
I have a html file that has invoice details I would like to know
If I have the following index [folder]Public_HTML ↳[folder]img ↳[file]logo.png ↳[file]index.html ↳[folder]contact ↳[file]index.html From the
I have an upload script that write a index.html file, I modified it to
I have a HTML file that has code similar to the following. <table> <tr>
I have a HTML file and a PHP file in the same folder on
I have a JavaScript function within an html file: <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML
I have a fairly simple app (just one index.html file and a css file
I have deleted public/index.html. Here is my config/routes.rb Those all I have in that
I have html-file. I have to replace all text between this: [%anytext%]. As 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.