Created
May 23, 2011 00:39
-
-
Save jocubeit/986050 to your computer and use it in GitHub Desktop.
Remove 'Search ' in title for filtered columns in Active Admin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/active_admin_filter_form_builder.rb | |
class ActiveAdmin::FilterFormBuilder | |
protected | |
def filter_string_input(method, options = {}) | |
field_name = "#{method}_contains" | |
[ label(field_name, "#{method.to_s.titlecase}"), | |
text_field(field_name) | |
].join("\n").html_safe | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/application_controller.rb | |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
# Remove 'Search ' in title for filtered columns in Active Admin | |
require 'active_admin_filter_form_builder.rb' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment