Skip to content

Commit

Permalink
Pass any special path options through to the tool's partial
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Nov 13, 2014
1 parent 836c5ab commit fa5d9b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/helpers/blacklight/catalog_helper_behavior.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def action_path name, action_opts, url_opts = nil
self.send(action_opts[:path] ||"#{name}_#{controller_name}_path", url_opts)
end

def render_document_action_partial name, opts
render(opts[:tool_partial] || 'document_action', locals: { name: name, opts: opts })
def render_document_action_partial name, opts, path_options = {}
render(partial: opts[:tool_partial] || 'document_action', locals: { name: name, opts: opts, path_options: path_options })
end
end
2 changes: 1 addition & 1 deletion app/views/bookmarks/_tools.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ul class="<%= controller_name %>Tools nav nav-pills">
<% document_actions.each do |name, opts| %>
<li class="<%= name %>">
<%= render_document_action_partial name, opts %>
<%= render_document_action_partial name, opts, id: @document %>
</li>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_document_action.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= link_to action_label(name, opts), action_path(name, opts, id: @document), {:id => "#{name}Link", :data => {:ajax_modal => "trigger"}} %>
<%= link_to action_label(name, opts), action_path(name, opts, path_options), {:id => "#{name}Link", :data => {:ajax_modal => "trigger"}} %>

0 comments on commit fa5d9b5

Please sign in to comment.