diff --git a/app/views/login/index.html.erb b/app/views/login/index.html.erb index 65d21cf..ef96305 100644 --- a/app/views/login/index.html.erb +++ b/app/views/login/index.html.erb @@ -6,7 +6,7 @@ <%= form_tag login_url do %>

<%= label_tag :email, "E-mail or Username:" %> - <%= text_field_tag :email, "", :size => 30 %> + <%= text_field_tag :email, "", :size => 30, :autofocus => "autofocus" %>
<%= label_tag :password, "Password:" %> @@ -24,9 +24,3 @@

<% end %> - - diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index 77aca46..2bd5e23 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb @@ -5,7 +5,8 @@ <%= form_tag "/search", :method => :get do %>
- <%= text_field_tag "q", @search.q, :size => 40 %> + <%= text_field_tag "q", @search.q, { :size => 40 }. + merge(@search.q.present? ? {} : { :autofocus => "autofocus" }) %>
@@ -43,14 +44,6 @@ <% end %> - - <% if !@search.q.present? %> - - <% end %> <% if @search.results.any? %>