Permalink
Browse files

[merb-auth-slice-password] Auth form needs merb-helpers

  • Loading branch information...
1 parent 4e5fcac commit 85f0caa39e2698fc0e3c3c25c36bd5b05dfa2a23 @ngollan ngollan committed May 16, 2011
Showing with 20 additions and 16 deletions.
  1. +20 −16 merb-auth-slice-password/app/views/exceptions/unauthenticated.html.erb
@@ -2,23 +2,27 @@
<div>
- <%= error_messages_for session.authentication %>
<% @login_param = Merb::Authentication::Strategies::Basic::Base.login_param %>
<% @password_param = Merb::Authentication::Strategies::Basic::Base.password_param %>
-
- <form action="<%= slice_url(:merb_auth_slice_password, :perform_login) %>" method="POST" accept-charset="utf-8">
- <input type="hidden" name="_method" value="PUT" />
- <div class="formRow">
- <label><%= @login_param.to_s.capitalize %>: <input type="text" name="<%= @login_param.to_s %>" value="" id="<%= @login_param.to_s %>"></label>
- </div> <!-- close: formRow -->
- <div class="formRow">
- <label><%= @password_param.to_s.capitalize %>:<input type="password" name="<%= @password_param.to_s %>" value="" id="<%= @password_param.to_s %>"></label>
- </div> <!-- close: formRow -->
- <div class="formRow">
- <input type="submit" name="Submit" value="Log In" id="Submit">
- </div> <!-- close: formRow -->
- </form>
+
+ <%= begin
+ form :action => slice_url(:merb_auth_slice_password, :perform_login), :method => :post, :"accept-charset" => 'utf-8' do %>
+ <%= error_messages_for session.authentication %>
+ <input type="hidden" name="_method" value="PUT" />
+ <div class="formRow">
+ <label><%= @login_param.to_s.capitalize %>: <input type="text" name="<%= @login_param.to_s %>" value="" id="<%= @login_param.to_s %>"></label>
+ </div> <!-- close: formRow -->
+ <div class="formRow">
+ <label><%= @password_param.to_s.capitalize %>:<input type="password" name="<%= @password_param.to_s %>" value="" id="<%= @password_param.to_s %>"></label>
+ </div> <!-- close: formRow -->
+ <div class="formRow">
+ <input type="submit" name="Submit" value="Log In" id="Submit">
+ </div> <!-- close: formRow -->
+ <% end
+ rescue %>
+ <div>The default login form for merb-auth-slice-passord requires merb-helpers to be loaded. Make sure to put it in your init.rb.</div>
+ <% end =%>
</div>
-
-
+
+

0 comments on commit 85f0caa

Please sign in to comment.