Forum: Ruby on Rails text_field_tag doesn't display after upgrade Rails from 2.3.18 to 4.0.4

F27ec882c17760270f028a61f4ab1b9e?d=identicon&s=25 Liz Huang (Guest)
on 2014-06-19 18:07
(Received via mailing list)
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 %>
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2014-06-19 18:10
(Received via mailing list)
On Thursday, June 19, 2014 4:45:37 PM UTC+1, Liz Huang wrote:
> 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
F27ec882c17760270f028a61f4ab1b9e?d=identicon&s=25 Liz Huang (Guest)
on 2014-06-19 19:19
(Received via mailing list)
Thanks a lot!

Liz
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.