0

So I have this login page in my rails app. I want the first form which is for the username to be allready selected by default, when I enter the page.

How can I achieve this?

Veske
  • 547
  • 1
  • 4
  • 15
  • 1
    if you mean focused, then this isn't related to rails. http://stackoverflow.com/questions/4166423/default-html-form-focus-without-javascript – jvnill Jan 17 '14 at 01:49

1 Answers1

1

Pass the autofocus: true option to the form helper:

= f.text_field :username, autofocus: true
steakchaser
  • 5,198
  • 1
  • 26
  • 34