Sign in through GitHub

eljago's Profile

GitHub User: eljago

Comments by

Avatar

yes, after you insert a new field, find the select element and call chosen on it.
In my case it was like this:

ruby
  $('form').on 'click', '.add_fields', (event) ->
    time = new Date().getTime()
    regexp = new RegExp($(this).data('id'), 'g')
    $(this).before($(this).data('fields').replace(regexp, time))
    $('fieldset.show_person_role:last .chzn-select').chosen()
    event.preventDefault()

this is my association:

ruby
<fieldset class="show_person_role">
<%= f.association :person, collection: Person.order('people.name ASC').all, :input_html => { :class => "chzn-select" } %>
</fieldset>

I add the class chzn-select which is used to find the element.

Avatar

I had the same problem. Found the solution here:

http://ubuntuforums.org/showthread.php?t=1396862

Uninstalled postgresql-common and reinstalled postgresql and libpq-dev

apt-get purge postgresql-common postgresql libpq-dev
apt-get install postgresql libpq-dev

Avatar

Great episode.
I'm new to rails and so happy I subscribed.