#these methods provide basic functionality for the user login system
#===================================================================
def login
+
return unless request.post?
self.current_user = User.authenticate(params[:login], params[:password])
if logged_in?
<% form_tag :controller => 'account', :action => 'login' do %>
<p><label for="login">Login</label></p>
- <p><%= text_field "Login", "login", :size => 30 %></p>
+ <p><%= text_field_tag 'login' %></p>
<p><label for="password">Password</label></p>
- <p><%= password_field "Password", "password", :size => 30 %></p>
+ <p><%= password_field_tag 'password' %></p>
- <p><%= submit_tag 'Login' %></p>
+ <p><%= submit_tag 'Log in' %></p>
<% end %>
<p><%= link_to 'Register for an account', :controller => 'account', :action => 'signup' %></p>
<p>You must have an account to start a new vote or to administer an
existing vote. You can log in or create a new account below.</p>
-
- <%= render_partial 'basic_login' %>
+
+ <%= render :partial => 'basic_login' %>
<% end %>
</div>