I want to create a button from the search result from Solr (7.5.0) in Blacklight (7.0.1) which on click should render a more-like-this view.
I have tried to include the button in the catalog_controller and calling the more-like-this view through a helper function. Also tried to direct the routes in the routes.rb.
The catalog_controller:
config.add_index_field 'id', helper_method: :more_like_this
The helper function
def more_like_this
render_document_sidebar_partial
end
catalog_helper_behavior.rb
def render_document_sidebar_partial(_document = @document)
render partial: 'show_sidebar'
end
Gives me the following error:
No route matches {:action=>"show", :controller=>"bookmarks", :id=>nil}, missing required keys: [:id]
How do I pass the id correctly?
I simply want Blacklight to render the more-like-this view in the right sidebar when the button is pushed.
Thanks in advance.
maybe you are missing the
indexaction for bookmarks (in your routes and maybe in your controller).the url you are going to is probably
/bookmarksbut you only have something likeget "/bookmarks/:id"in your routes so it's not finding the required:idparameter.