Ajax-ify Hobo-login and friends --Enhancement
Reported by jet | October 25th, 2009 @ 04:15 PM | in Hobo 1.0 - Final
Would like to see Hobo-login and friends become Ajax friendly
to
enable Ajax actions.
Here is the solution Bryan Larsen helped me with to implement this:
<def tag="login-form">
<form action="&user_login_path" class="login" merge>
<labelled-item-list param>
<labelled-item>
<item-label param="login-label">EMAIL ADDRESS</item-label>
<item-value>
<input type="text" name="login" id="login" class="string" param="login-input" />
</item-value>
</labelled-item>
<labelled-item>
<item-label param="password-label-architect">
PASSWORD
</item-label>
<item-value>
<input type="password" name="password" id="password" class="string" param="password-input"/>
</item-value>
</labelled-item>
</labelled-item-list>
<submit label='LOG IN' param/> or <cancel />
</div>
</form>
</def>
And in users_controller.rb the action:
def login
if logged_in?
respond_to do |wants|
wants.html { redirect_to home_page }
wants.js { hobo_ajax_response }
end
else
hobo_login do
respond_to do |wants|
wants.html { }
wants.js { hobo_ajax_response }
end
end
end
end
Thank you,
Jet
Comments and changes to this ticket
-
Bryan Larsen October 29th, 2009 @ 11:00 PM
- Tag changed from hobo-login, rapid to enhancement, hobo-login, rapid
- Milestone set to Hobo 1.0 - Final
-
Bryan Larsen October 29th, 2009 @ 11:00 PM
- State changed from new to open
-
Bryan Larsen December 1st, 2009 @ 07:59 PM
- State changed from open to resolved
(from [ecd5a0e7584860f8cadfe9aebb74bcc54afbd853]) [#514 state:resolved] ajaxify hobo_login and friends http://github.com/tablatom/hobo/commit/ecd5a0e7584860f8cadfe9aebb74...
-
Bryan Larsen February 21st, 2010 @ 03:18 AM
(from [08c956b572c0cffa75cbcc6dc0559dcadf065428]) [#633 state:resolved] [#514] hobo_login does not do ajax if login fails http://github.com/tablatom/hobo/commit/08c956b572c0cffa75cbcc6dc055...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Tags
Referenced by
- 514 Ajax-ify Hobo-login and friends --Enhancement (from [ecd5a0e7584860f8cadfe9aebb74bcc54afbd853]) [#514 s...
- 518 Hobo_login calls its block before checking to see if the user is active I took a look at this while looking at #514, and I agree ...
- 633 hobo_login does not do ajax if login fails (from [08c956b572c0cffa75cbcc6dc0559dcadf065428]) [#633 s...
- 514 Ajax-ify Hobo-login and friends --Enhancement (from [08c956b572c0cffa75cbcc6dc0559dcadf065428]) [#633 s...