It should be possible to customise the way errors are presented with ajax forms
Reported by Tom Locke | September 5th, 2008 @ 04:45 PM | in Beyond Hobo 1.0
At the moment it's hard wired to give a javascript alert, which is not the greatest solution.
Comments and changes to this ticket
-
Matt Jones September 8th, 2008 @ 09:04 PM
Not a solution, but this change would at least avoid the alert:
-
make the onFailure handler more like the others in hobo_rapid.js, to avoid displaying the alert
-
change the wants.js part in model_controller.rb, about line 533 to
wants.js do render :status => 500, :content_type => "text/javascript", :update => true do |page| page << "$$('div.flash').each(Element.remove)" page.insert_html :top, page.literal("$$('div.with-flash')[0]"), "<div class=\"flash error\">There was a problem with that change.<br>#{@this.errors.full_messages.join("<br>")}</div>" page.literal('alert("Pond!");') end end
This new code uses RJS to replace (or insert) the flash box with the error.
-
-
Tom Locke September 11th, 2008 @ 10:12 AM
- State changed from new to open
-
Tom Locke September 15th, 2008 @ 05:21 PM
- Milestone changed from Hobo 1.0 - Final to Beyond Hobo 1.0
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 ยป