text_field_tag doesn't display after upgrade Rails from 2.3.18 to 4.0.4

26 views
Skip to first unread message

Liz Huang

unread,
Jun 19, 2014, 11:45:37 AM6/19/14
to rubyonra...@googlegroups.com

Hi,

I developed a few simple apps using Ruby On Rails (no database) for researchers, we
got a new server (Mac Pro) and I try to develop in rails 4.0.4, I have this piece of
code in index.rhtml, but not anymore if I copy it to index.html.erb, I don't get
any error, but text_field_tag and submit_tag are not displaying, I read manuals
about form_tag, text_field_tag and submit_tag, they don't seem to change
much, what I might be doing wrong? Thanks a lot for your advice.

  <td valign=top>
    <h3>Sample size calculation</h3>
      <% form_tag('/progress') do %>
      <table cellspacing=3 cellpadding=3>

        <tr>
          <td> Condition Number : </td><td><%= text_field_tag( "cond", value = nil, :size => "10" )    %></td>
        </tr>

        <tr>
          <td> Number of People : </td><td><%= text_field_tag( "no", value = nil, :size => "10" )    %></td>
        </tr>

        <tr>
          <td> <div><%= submit_tag "Compute" %></div></p>
        </tr>
      </table>
    <% end %>

Frederick Cheung

unread,
Jun 19, 2014, 12:08:30 PM6/19/14
to rubyonra...@googlegroups.com


On Thursday, June 19, 2014 4:45:37 PM UTC+1, Liz Huang wrote:

Hi,

I developed a few simple apps using Ruby On Rails (no database) for researchers, we
got a new server (Mac Pro) and I try to develop in rails 4.0.4, I have this piece of
code in index.rhtml, but not anymore if I copy it to index.html.erb, I don't get
any error, but text_field_tag and submit_tag are not displaying, I read manuals
about form_tag, text_field_tag and submit_tag, they don't seem to change
much, what I might be doing wrong? Thanks a lot for your advice.

  <td valign=top>
    <h3>Sample size calculation</h3>
      <% form_tag('/progress') do %>

In rails 3 and above you need to use <%= for form_tag

Fred 

Liz Huang

unread,
Jun 19, 2014, 1:18:24 PM6/19/14
to rubyonra...@googlegroups.com


Thanks a lot!

Liz
Reply all
Reply to author
Forward
0 new messages