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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:28:01+00:00 2026-05-24T11:28:01+00:00

I am learning ruby on rails using aptana studio 3. I created a view

  • 0

I am learning ruby on rails using aptana studio 3. I created a view hello.rhtml. When I run the view and see the source I get to see js files automatically included. Even if my rhtml file is empty for eg

hello world

Without the html markup, and if I see the source, I can see the entire markup from html doctype etc already present. How do I stop the inclusion of automatic markup?

EDIT:

I create a hello.html.erb file. And put this code inside it

Hello

When I save and run the file, I get the output, but when I view source I get the following result.

<!DOCTYPE html>
<html>
<head>
  <title>Demo</title>
  
  <script src="/javascripts/prototype.js?1312799421" type="text/javascript"></script>
<script src="/javascripts/effects.js?1312799421" type="text/javascript"></script>
<script src="/javascripts/dragdrop.js?1312799421" type="text/javascript"></script>
<script src="/javascripts/controls.js?1312799421" type="text/javascript"></script>
<script src="/javascripts/rails.js?1312799421" type="text/javascript"></script>

<script src="/javascripts/application.js?1312799421" type="text/javascript"></script>
  <meta name="csrf-param" content="authenticity_token"/>
<meta name="csrf-token" content="82LBP1pI5h0QzNW54PYSq/zdkS8kF4Z/nKSUHgKvv1g="/>
</head>
<body>

<html>
  <head><title>Hello</title></head>
  <body>
</body>
</html>


</body>
</html>

As you see, I get html inside html and when in browser my title shows "Demo" instead of "Hello"

Update:

Here is the content of application layout. And I now understand that, the code is coming from this layout.

<!DOCTYPE html>
<html>
<head>
  <title>Demo</title>
  <%= stylesheet_link_tag :all %>
  <%= javascript_include_tag :defaults %>
  <%= csrf_meta_tag %>
</head>
<body>

<%= yield %>

</body>
</html>

What is the best practice and what code should be present in application_layout.html.erb? I would like all my view files to have its own html code.

  • 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-24T11:28:02+00:00Added an answer on May 24, 2026 at 11:28 am

    Your view should have .html.erb extension not rhtml (That’s a hang over from Rails 1.x).
    Check out your application layout file. in the head section you’ll see an entry for including JavaScript. Just comment that out and you js will not be included.

    UPDATE
    Have a close look at your application_layout.html.erb.

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

Sidebar

Related Questions

Using Rails3 and Ruby 1.9.2, I am new, just learning Ruby/Rails-- When I run
I'm learning Ruby on Rails. I'm using some associations (has_many :through, ...) But i'm
Now about 2 weeks into learning Ruby and Rails, I've found myself using the
I am using text mate on the mac whilst learning Ruby on Rails. However
I am learning Ruby on Rails using a book I picked up called Head
I just started learning ruby on rails. I'm using 'Agile Web Development with Rails,
I am stating out learning Ruby on Rails. For that I am using Agile
I'm just learning Ruby on Rails. I've read a few books, I've watched lots
I am learning Ruby on Rails so I'm sure I'll find this out sooner
I'm just learning ruby on rails and I have a table of user roles

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.