RailsCasts Pro episodes are now free!

Learn more or hide this

ricsrock's Profile

GitHub User: ricsrock

Comments by ricsrock

Avatar

I'm using this technique to add/edit multiple people to/in a household. It's a rails 4 application using turbo links along with query.turbolinks.

My application also uses jQuery datepicker plugin.

My _person_fields partial includes a date field that uses the date picker plugin, but it doesn't work. The datepicker is not being initialized in the dynamically added person_fields partials.

I've tried several methods from the Turbolinks episode with no success.

This is beyond my familiarity, but I think I need to somehow call document ready after the person_fields partial is added. Don't know how to do that.

Any suggestions are appreciated. Thanks!

Avatar

Found this line, from here:

ruby
page.execute_script %Q{ $('.ui-menu-item a:contains("#{the_option_text_you_want_to_choose}")').trigger("mouseenter").trigger("click"); }

And it works!

Avatar

How would one test this with rspec & capybara? I haven't been able to select an option from the autocomplete list with capybara. Anyone been successful with this?