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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:18:28+00:00 2026-06-14T19:18:28+00:00

I have a html file and I need to rewrite it in Rails style.

  • 0

I have a html file and I need to rewrite it in Rails style. I tried to read the rails guides but couldn’t find much useful info. Here’s part of the HTML i have.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<% content_for :head do -%>
  <%= stylesheet_link_tag 'css.css' %>

<% end %>

<head>
<title>index</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" media="all" type="text/css" href="css/css.css" />
<script language="JavaScript" type="text/javascript" src="images/jquery-1.7.1.min.js"></script>
<script language="JavaScript" type="text/javascript" src="images/jQuery.infiniteCarousel.js">        
</script>
<script language="JavaScript" type="text/javascript" src="images/jQuery.tbSwitching.js"></script>
<script language="JavaScript" type="text/javascript" src="images/myfocus-1.2.4.full.js"></script>
<script language="JavaScript" type="text/javascript" src="images/mF_expo2010.js"></script>
<link href="images/mF_expo2010.css" rel="stylesheet" type="text/css" />
</head>
<body>
<center>
<div id="top">
 <div class="one">
     <div class="one1">
         <img src="images/ico1.png"  width="225" height="58"/>
     </div>
     <div class="one2">
         <div class="one3">
              <div class="one4">Login/Sign up</div> 
              <div class="one4">Create an Account </div>    
              <div class="one5">shopping bag</div>   
         </div>
     </div>
  </div>
</div>
<div class="two">
<% content_for :below_body do -%>
  <%= javascript_include_tag 'images/jquery-1.7.1.min.js' %>
  <%= javascript_include_tag 'images/jQuery.infiniteCarousel.js' %>
 <%= javascript_include_tag 'images/jQuery.tbSwitching.js' %>
 <%= javascript_include_tag 'images/myfocus-1.2.4.full.js' %>
     <%= javascript_include_tag 'images/mF_expo2010.js' %>
<% end %>   

<script>
$(function(){
    $("#top .two3").hover(function(){   
    $("#top .two3").removeClass("on").next(".two4").removeClass("ac");
    $(this).addClass("on").next(".two4").addClass("ac");        
},function(){   

});
})
</script>
<script>
$(function(){
    $("#top .two5 a").hover(function(){     
    $(this).addClass("on");     
},function(){   
    $(this).removeClass("on");
    });
})
</script>
......
</body>
</html>

I tried to revise it by using the code below inside the body tag but didn’t seem to work.

<% content_for :below_body do -%>
    <%= javascript_include_tag 'images/jquery-1.7.1.min.js' %>
    <%= javascript_include_tag 'images/jQuery.infiniteCarousel.js' %>
    <%= javascript_include_tag 'images/jQuery.tbSwitching.js' %>
    <%= javascript_include_tag 'images/myfocus-1.2.4.full.js' %>
    <%= javascript_include_tag 'images/mF_expo2010.js' %>
<% end %>   

Should I put it inside the head instead?
Also should I do anything with the tag?
Thanks

  • 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-14T19:18:29+00:00Added an answer on June 14, 2026 at 7:18 pm

    General rule of thumb is that library should go into the head (like jQuery), all the other code that uses jQuery for example should go below the code. The reason for this is, that everything that you want to talk to as a DOM element with jQuery has to be rendered (i.e. above your js code) in the document.

    What I usually do is append everything, i.e. all script, at the end of the page. This way the loading times of the page itself will reduce, as the request from HTTP does not load the JS first and then the HTML.

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

Sidebar

Related Questions

I have an html file and i need to generate a list of all
I have a HTML/CSS File laid out with a bunch of areas that need
I have this tag into my html file: {{block:my_test_block}} {{news:my_test_block2}} I need to parse
I have an XSLT file generating plain HTML. I need to wrap some elements
I have an html file in assets, aaa.html. I want to read the contents
How can I rewrite file extension, so when file have extension html, Apache thinks
I am a newbie to Python. I have a HTML file where I need
I have an html file that I need to take any tag and put
I have a html file need to refresh every 10 seconds, so I have
I have an html file which has to be parsed using selenium. I need

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.