# Strange View Problem

**URL:** <https://www.ruby-forum.com/t/strange-view-problem/173322>\
**Category:** Rails\
**Created:** [August 6, 2009, 9:09pm UTC](https://www.ruby-forum.com/t/strange-view-problem/173322 "2009-08-06T21:09:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skeptic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e480ec/32.png) [@skeptic](https://www.ruby-forum.com/u/skeptic)\
**Post date:** [August 6, 2009, 9:09pm UTC](https://www.ruby-forum.com/t/strange-view-problem/173322/1 "2009-08-06T21:09:36Z")

</div>

Hi,

I’ve come across a strange issue with one of my views.

Simple login form,

\<% form\_tag do -%\>

```
    <p><label for="login">Login</label><br/>
    <%= text_field_tag 'login' %></p>

    <p><label for="password">Password</label><br/>
    <%= password_field_tag 'password' %></p>

    <p><%= submit_tag 'Log in' %></p>

```

\<% end -%\>

But browsers are rendering the text field input box huge.  
It’s like a mini text area.  
The only happens when I pass in ‘login’ as a parameter to  
text\_field\_tag.  
If I pass it password, the input box is rendered as a correct size.

Any ideas ?

Strange one so it is

---

<div class="post-metadata">

**Author:** ![skeptic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e480ec/32.png) [@skeptic](https://www.ruby-forum.com/u/skeptic)\
**Post date:** [August 6, 2009, 9:31pm UTC](https://www.ruby-forum.com/t/strange-view-problem/173322/2 "2009-08-06T21:31:41Z")

</div>

2009/8/6 Gary C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Â Â Â Â \<%= text\_field\_tag ‘login’ %\>
> 
>   
> The only happens when I pass in ‘login’ as a parameter to  
> text\_field\_tag.  
> If I pass it password, the input box is rendered as a correct size.

Have you had a look at the generated html (View, Page Source or  
similar in browser) to see if it looks ok?  
Also try copying the complete source and pasting into html checker at  
[The W3C Markup Validation Service](http://validator.w3.org/#validate_by_input) in case something else on  
the page is messing it up and confusing the browser.

Colin

---

<div class="post-metadata">

**Author:** ![skeptic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e480ec/32.png) [@skeptic](https://www.ruby-forum.com/u/skeptic)\
**Post date:** [August 7, 2009, 6:05am UTC](https://www.ruby-forum.com/t/strange-view-problem/173322/3 "2009-08-07T06:05:39Z")

</div>

firebug is your friend.  
As colin suggested, viewing the source code in your browser will give  
you a clue as to what is happening.

If you use firebug (plugin for firefox) to inspect element you will see  
all the css, layout and source code, you can even edit the soirce code  
as you look at it and when you are happy that you have what you need go  
and change your files.

It’s just one of those tools that you can live without once you’ve used  
it.

---

<div class="post-metadata">

**Author:** ![skeptic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e480ec/32.png) [@skeptic](https://www.ruby-forum.com/u/skeptic)\
**Post date:** [August 7, 2009, 10:26am UTC](https://www.ruby-forum.com/t/strange-view-problem/173322/4 "2009-08-07T10:26:53Z")

</div>

Thanks lads.  
I’ll check that when I finish work.
