Message from discussion
Display inline errors with simple_form in a Bootstrap Ajax modal
Received: by 10.50.213.99 with SMTP id nr3mr1541864igc.2.1353026672957;
Thu, 15 Nov 2012 16:44:32 -0800 (PST)
X-BeenThere: plataformatec-simpleform@googlegroups.com
Received: by 10.50.193.228 with SMTP id hr4ls596854igc.18.canary; Thu, 15 Nov
2012 16:44:31 -0800 (PST)
Received: by 10.50.153.234 with SMTP id vj10mr909056igb.4.1353026671882;
Thu, 15 Nov 2012 16:44:31 -0800 (PST)
Date: Thu, 15 Nov 2012 16:44:31 -0800 (PST)
From: mcbsys <mcbsyst...@gmail.com>
To: plataformatec-simpleform@googlegroups.com
Message-Id: <33759c30-83a1-4ee6-ba53-d25b4a47aec1@googlegroups.com>
Subject: Display inline errors with simple_form in a Bootstrap Ajax modal
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_933_23695145.1353026671461"
------=_Part_933_23695145.1353026671461
Content-Type: multipart/alternative;
boundary="----=_Part_934_5322062.1353026671465"
------=_Part_934_5322062.1353026671465
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Is anyone aware of a comprehensive guide on using simple_form with a
Bootstrap modal, especially getting the inline errors to work?
It seems the thing to do or error is re-render the entire form on the
server (with errors), push that to the client as JavaScript, and use Ajax
to inject it into the modal. I'm close, but it's looking at my JavaScript
as a JSON variable and giving me a "JSON.parse: unexpected character"
error. I've posted my current code here:
http://stackoverflow.com/questions/13408508/display-inline-errors-with-simple-form-in-a-bootstrap-ajax-modal
Is there a better way? I saw one article<http://www.readncode.com/blog/2012/05/28/create-new-records-with-bootstrap-modal-and-unobtrusive-javascript-in-rails/>that recommends client-side validations, but it doesn't seem like that
should be necessary.
Thanks,
Mark Berry
MCB Systems
------=_Part_934_5322062.1353026671465
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
Is anyone aware of a comprehensive guide on using simple_form with a Bootstrap modal, especially getting the inline errors to work? <br><br>It seems the thing to do or error is re-render the entire form on the server (with errors), push that to the client as JavaScript, and use Ajax to inject it into the modal. I'm close, but it's looking at my JavaScript as a JSON variable and giving me a "JSON.parse: unexpected character" error. I've posted my current code here:<br><br>http://stackoverflow.com/questions/13408508/display-inline-errors-with-simple-form-in-a-bootstrap-ajax-modal<br><br>Is there a better way? I saw <a href="http://www.readncode.com/blog/2012/05/28/create-new-records-with-bootstrap-modal-and-unobtrusive-javascript-in-rails/">one article</a> that recommends client-side validations, but it doesn't seem like that should be necessary.<br><br>Thanks,<br><br>Mark Berry<br>MCB Systems<br><br>
------=_Part_934_5322062.1353026671465--
------=_Part_933_23695145.1353026671461--