Having trouble passing value from radio button when submit
Hi,
I am using your default blacklight application trying to create radio button instead of a drop down. I am not able to to pass radio button value after I submit the form. Non of the radio button would selected. I was trying to create params as suggested in many forum but have no luck. I put the params in catalog_controller.rb. Please help.
Here is my code:
_search_form.html.erb
<%= radio_button_tag :search_field, 'title' %> <%= label_tag :title, "Title" %> <%= radio_button_tag :search_field,'author' %> <%= label_tag :author, "Author" %> <%= radio_button_tag :search_field, 'subject' %> <%= label_tag :subject, "Subject" %>
catalog_controller.rb
class CatalogController < ApplicationController
include Blacklight::Catalog
def _search_form @searchfield = params[:search_field] end
end
Have you tried def index in the catalog controller rather than def '_search_form'?
Closing for lack of feedback. Also, sounds like a question about Rails mechanics better answered on-list.