RailsCasts Pro episodes are now free!

Learn more or hide this

indiemdq's Profile

GitHub User: indiemdq

Comments by

Avatar

Excellent screencast,
I've been using it for a while, imho bootstrap is easier to use, but foundation is easier to customize

Avatar

if your form is preloaded with the page it should work. Foundation uses javascript to create custom select, checkboxes and radiobuttons, if you load it on demand you need to run the custom-form javascript after.

Example:

javascript
$(document).foundation('forms', 'assemble');

For more information check Foundation - Javascript

Avatar

I've solved the problem, my problem was that the js.coffee file wasn't been included in the application.js file, that explains why the converted js worked directly on the application.js file, I had to added manually //= require ....js.coffee in the application.js file because i've removed the require_tree directive.

Avatar

Maybe you have a lib conflict, I had to try with some adjustments to the Js code and It worked for me, also i had to put it in the application.js obviously there is other problem there, but at least is working
This is my code:

$('form').on ('click', '.add_fields',
function(event) {
time = new Date().getTime()
regexp = new RegExp($(this).data('id'), 'g')
$(this).before($(this).data('fields').replace(regexp, time))
event.preventDefault()}
)