# Problem with login example in Agile Web Development with Rub

**URL:** <https://www.ruby-forum.com/t/problem-with-login-example-in-agile-web-development-with-rub/82001>\
**Category:** Ruby\
**Created:** [January 16, 2007, 8:05pm UTC](https://www.ruby-forum.com/t/problem-with-login-example-in-agile-web-development-with-rub/82001 "2007-01-16T20:05:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chhenning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bb73d2/32.png) [@chhenning](https://www.ruby-forum.com/u/chhenning)\
**Post date:** [January 16, 2007, 8:05pm UTC](https://www.ruby-forum.com/t/problem-with-login-example-in-agile-web-development-with-rub/82001/1 "2007-01-16T20:05:16Z")

</div>

Hi all, this is the first time I’m posting to this list or all Ruby on  
Rails lists, at all. If I’m wrong here please let me know where the  
best place is to put my question.

I’m doing the authentication example in the new Agile Development with  
Rails book. For whatever reason the user login page doesn’t work. The  
login.rhtml looks like this:

 Please Log In

```
<% form_tag do %>
  <p>
    <label for="name">Name:</label>
    <%= text_field_tag :name, params[:name] %>
  </p>

  <p>
    <label for="password">Password:</label>
    <%= password_field_tag :password, params[:password] %>
  </p>

  <p>
    <%= submit_tag "Login" %>
  </p>
<% end %>

```

But when trying to display this site there aren’t any input fields.  
Seems to me the “form\_tag do” does produce any html code. My Firefox  
browser simply shows the following page source.

 Admin: login 
 Please Log In 

Does anybody know what might be wrong with my application? Any hint is  
very welcome. I’m in my first steps of using Ruby on Rails.

Thanks ahead,  
Christian

---

<div class="post-metadata">

**Author:** ![chhenning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bb73d2/32.png) [@chhenning](https://www.ruby-forum.com/u/chhenning)\
**Post date:** [January 16, 2007, 8:37pm UTC](https://www.ruby-forum.com/t/problem-with-login-example-in-agile-web-development-with-rub/82001/2 "2007-01-16T20:37:24Z")

</div>

On 1/16/07, chhenning [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all, this is the first time I’m posting to this list or all Ruby on  
> Rails lists, at all. If I’m wrong here please let me know where the  
> best place is to put my question.

There is a google group specifically for Rails, so you might get  
better help there.

> Password: But when trying to display this site there aren't any input fields. Seems to me the "form\_tag do" does produce any html code. My Firefox browser simply shows the following page source.

There is a new way to do this s seen here:  
[http://www.loudthinking.com/arc/000601.html](http://www.loudthinking.com/arc/000601.html)

and old way seen here:  
[http://api.rubyonrails.com/classes/ActionView/Helpers/FormTagHelper.html#M000497](http://api.rubyonrails.com/classes/ActionView/Helpers/FormTagHelper.html#M000497)

My action pack 1.12.5 seems to support just the old one.  
[api.rubyonrails.com](http://api.rubyonrails.com) knows nothing about the new one. Maybe this works  
in development version (would be 1.2) only

So either change your script to use the old form, or install egderails  
(I won’t help you with this, I guess it involves getting rails  
directly from SVN)

J.

---

<div class="post-metadata">

**Author:** ![chhenning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bb73d2/32.png) [@chhenning](https://www.ruby-forum.com/u/chhenning)\
**Post date:** [January 16, 2007, 11:03pm UTC](https://www.ruby-forum.com/t/problem-with-login-example-in-agile-web-development-with-rub/82001/3 "2007-01-16T23:03:56Z")

</div>

On Jan 16, 2007, at 1:05 PM, chhenning wrote:

> Does anybody know what might be wrong with my application? Any hint is  
> very welcome. I’m in my first steps of using Ruby on Rails.

Did you install the version of Rails cited inside the book’s front  
cover, and run rake rails:update?

Dave

---

<div class="post-metadata">

**Author:** ![chhenning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bb73d2/32.png) [@chhenning](https://www.ruby-forum.com/u/chhenning)\
**Post date:** [January 17, 2007, 10:35am UTC](https://www.ruby-forum.com/t/problem-with-login-example-in-agile-web-development-with-rub/82001/4 "2007-01-17T10:35:36Z")

</div>

chhenning wrote:

> ```
> <% form_tag do %>
> 
> ```

> Does anybody know what might be wrong with my application? Any hint is  
> very welcome. I’m in my first steps of using Ruby on Rails.  
> Didn’t you forget = in the construction above? So it should look  
> like:  
> \<%= form\_tag do %\>  
> …

---

<div class="post-metadata">

**Author:** ![chhenning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bb73d2/32.png) [@chhenning](https://www.ruby-forum.com/u/chhenning)\
**Post date:** [January 17, 2007, 3:31pm UTC](https://www.ruby-forum.com/t/problem-with-login-example-in-agile-web-development-with-rub/82001/5 "2007-01-17T15:31:50Z")

</div>

On Jan 17, 2007, at 3:35 AM, gmarik wrote:

> chhenning wrote:
> 
> > ```
> > <% form_tag do %>
> > 
> > ```
> 
> > Does anybody know what might be wrong with my application? Any  
> > hint is  
> > very welcome. I’m in my first steps of using Ruby on Rails.  
> > Didn’t you forget = in the construction above? So it should look  
> > like:  
> > \<%= form\_tag do %\>  
> > …

No, that form is what should be used in 1.2. It works as long as  
you’re running a 1.2 RC, or the code .zip file provided with the book.

Dave

---

<div class="post-metadata">

**Author:** ![chhenning](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bb73d2/32.png) [@chhenning](https://www.ruby-forum.com/u/chhenning)\
**Post date:** [January 17, 2007, 10:42am UTC](https://www.ruby-forum.com/t/problem-with-login-example-in-agile-web-development-with-rub/82001/6 "2007-01-17T10:42:37Z")

</div>

On 1/17/07, gmarik [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> chhenning wrote:
> 
> > ```
> > <% form_tag do %>
> > 
> > ```
> 
> > Does anybody know what might be wrong with my application? Any hint is  
> > very welcome. I’m in my first steps of using Ruby on Rails.  
> > Didn’t you forget = in the construction above? So it should look  
> > like:  
> > \<%= form\_tag do %\>  
> > …

No. See DHH’s blog. You either use = or do…end (if you have 1.2) and  
= without block in 1.0. See  
lib/actionpack/actionview/tag\_form\_helper.rb
