Wire up sign in action
This commit is contained in:
parent
c2601c708a
commit
135d017d2c
|
@ -109,7 +109,15 @@
|
|||
if(errors.length > 0) {
|
||||
errors[0].focus();
|
||||
} else {
|
||||
$.post('<%= user_session_path :format => "json" %>', $(this).serialize(), function(data) {
|
||||
$.post('<%= user_session_path :format => "json" %>', {
|
||||
'remote' : true,
|
||||
'commit' : $('#user_existing_submit').val(),
|
||||
'utf8' : '✓',
|
||||
'user' : {
|
||||
'email' : $('#user_email').val(),
|
||||
'password' : $('#user_password').val()
|
||||
}
|
||||
}, function(data) {
|
||||
});
|
||||
}
|
||||
} else if($(this).data('state') === 'user_forgot_password') {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<div id="user_existing_fields" style="display: none;">
|
||||
<%= f.label "password", "Password", :id => "user_password_label" %>
|
||||
<%= f.password_field "password", :tabindex => 0 %>
|
||||
<%= f.label "remember_me", (f.check_box("remember_me").html_safe + "Stay signed in"), :id => "user_remember_me_label" %><br />
|
||||
<%= f.label "remember_me", (f.check_box("remember_me", :checked => true, :tabindex => 0).html_safe + "Stay signed in"), :id => "user_remember_me_label" %><br />
|
||||
<%= f.submit "Sign in", :tabindex => 0, :id => "user_existing_submit" %>
|
||||
<p><%= link_to "Forgot your password?", "#", :id => "user_forgot_password_link", :tabindex => 0 %></p>
|
||||
</div>
|
||||
|
|
|
@ -124,7 +124,7 @@ Devise.setup do |config|
|
|||
# access, but formats like :xml or :json, should return 401.
|
||||
# If you have any extra navigational formats, like :iphone or :mobile, you
|
||||
# should add them to the navigational formats lists. Default is [:html]
|
||||
config.navigational_formats = [:html, :json]
|
||||
# config.navigational_formats = [:html, :iphone]
|
||||
|
||||
# ==> Warden configuration
|
||||
# If you want to use other strategies, that are not (yet) supported by Devise,
|
||||
|
|
Loading…
Reference in New Issue