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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:52:23+00:00 2026-05-23T00:52:23+00:00

Rails 3.0.7, Windows 7, NetBeans 6.9.1, JRuby 1.5.1, Ruby 1.8.7 I have app/views/browsing/index.rhtml with

  • 0

Rails 3.0.7, Windows 7, NetBeans 6.9.1, JRuby 1.5.1, Ruby 1.8.7

I have app/views/browsing/index.rhtml with this relevant part, focus on the render call:

<table>
  <tr>
    <th><em><%=I18n.t('browsing.actions')%></em></th>
    <% colnames = @_controller.model_class.column_names %>
    <% colnames.each do |name| %>
    <% render  :partial => 'browsing/header_field', :locals => {:name => name} %>
    <% end %>
  </tr>

And I have app/views/browsing/_header_field.rhtml with the following content:

<% puts "DEBUG: rendering " + name + " field." %>
<% if @_controller.orderables.include?(name.to_sym) %>
<%
  otext = ''
  oopts = @_controller.orderings[name];
  if !oopts.nil?
    otext += ' ' + (oopts[:is_asc] ? '↓' : '↑')
    otext += '<span class="small">'+oopts[:prio].to_s+'</span>'
  end
%>
<th><%=link_to( name.tr('_',' '), { :controller => controller_path, :action => 'index', :o => name }, {:class => 'sort'} )%>
<%=((otext=='' || @_controller.orderings.size<=1) ? raw(otext) : link_to(raw(otext), { :controller => controller_path, :action => 'index', :o => name, :x => true }, {:class => 'delete_sort', :title => I18n.t('browsing.delete_sort')}))%></th>
<% else %>
<th><%=name.tr('_',' ')%></th>
<% end %>

The debug-print (first line) is executed properly, I can see it in the output window. I can use the NetBeans IDE to watch the execution of this file line by line, it happens as it is expected

The problem is that the results of this rendering are somehow dropped out on the window, there is nothing (no table header cells) in the final rendered HTML. That is rendered (only relevant part):

<table>
  <tr>
    <th><em>Actions</em></th>
  </tr>

The output window produces this:

DEBUG: rendering id field.
DEBUG: rendering inm_device_id field.
DEBUG: rendering changes_id field.

Started GET "/changes_and_devices" for 127.0.0.1 at Wed Jun 08 11:50:01 +0200 2011
  Processing by ChangesAndDevicesController#index as HTML
  ChangeAndDevice Load (2.0ms)  SELECT `changes_and_devices`.* FROM `changes_and_devices` ORDER BY id desc LIMIT 20 OFFSET 0
  SQL (18.0ms)  SELECT COUNT(*) FROM `changes_and_devices`
Rendered browsing/_header_field.rhtml (6.0ms)
Rendered browsing/_header_field.rhtml (6.0ms)
Rendered browsing/_header_field.rhtml (5.0ms)
Rendered browsing/index.rhtml within layouts/application (189.0ms)
Completed 200 OK in 245ms (Views: 207.0ms | ActiveRecord: 20.0ms)

All hints are welcome! Thanks in advance!

  • 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-23T00:52:24+00:00Added an answer on May 23, 2026 at 12:52 am

    Yep, <% only evaluates where <%= also displays evaluated code.

    You need to change
    <% render :partial => 'browsing/header_field', :locals => {:name => name} %>
    to
    <%= render :partial => 'browsing/header_field', :locals => {:name => name} %>

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

Sidebar

Related Questions

Trying to add simplecov to my Rails app (Jruby 1.6.4, Ruby 1.9.2, Windows). I
I am using Netbeans to develop a Ruby on Rails application. Unfortunately, I have
When attempting to create a new Ruby on Rails app in Windows the command
I have a Rails app that I developed on Windows. Now I'm bringing it
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
I just installed ruby on rails on windows. install mysql and created a new
Trying to find the sqlserver adapter for rails on windows. I have tried getting
So I installed Ruby On Rails using the Windows Installer. Now the startup guides
I am using: rails 2.3.5 ruby 1.8.7 and Windows 7 Home Basic I was
I am using: Rails 2.3.5 Ruby 1.8.7 Windows 7 Home basic 64-bit I'm trying

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.