turbolinks / turbolinks-classic

Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
MIT License
3.54k stars 428 forks source link

going through model causes turbo links to trigger controller action twice. #631

Closed mmplisskin closed 8 years ago

mmplisskin commented 8 years ago

I have a controller action that pulls a few random events on the index page. There is a link on the page to link to the same controller action with turbolinks this replaces the events partial. when going through the child relationship in the view everything works correctly but if going through the parent relationship and then pulling the child relationship the same controller action is called twice thus the database is not reflective of the view. i.e.

controller
@event_links = @plan.event_links
 view
<% @event_links.each do |event_link| %>
     <% event = event_link.event %>
     <%= event.name %>
<% end %> 

The above does not work

But this does:

controller
@events = @plan.events
view
<% @events.each do |event| %> 
     <%= event.name %>
<% end %>
mmplisskin commented 8 years ago

This is not the issue it has to do with additional html I will close this.