I have recently started breaking up some of my apps using engines I ran into some issues with the routing from some links in a shared partial I am using. The partial looks like this:
shared/delete_link.html.erb
<%= link_to object,
method: :delete,
data: { confirm: 'Are you sure?' } do%>
<span class="glyphicon glyphicon-remove"></span>
<% end %>
I call the partial like this; passing it the object I want deleted:
<%= render "shared/delete_link", :object => search %>
This works fine for models/routes that are still in the main app but now I have a situation like this:
|-controller(main-app)
|--show(main-app)
|---partial(engine)
|----partial-delete-link(main-app)
|-----link-route(engine)
Where the partial is rendered by a controller in the main app with a delete link for a route in the engine. The only thing that matters(I think) is that the controller is in the main app and the route for the object is in the mounted engine so it needs to be namespaced.
How can I restore functionality without putting a lot of logic into my view?