lib/admin_assistant/column.rb in admin_assistant-2.0.0.pre1 vs lib/admin_assistant/column.rb in admin_assistant-2.0.0.pre2

- old
+ new

@@ -35,21 +35,23 @@ if after after else helper_method = "after_#{name}_input" if @action_view.respond_to?(helper_method) - @action_view.send(helper_method, rails_form.object) + @action_view.raw( + @action_view.send(helper_method, rails_form.object) + ) end end end def description @description end def errors(record) - record.errors.on name + record.errors[name] end def html(rails_form) record = rails_form.object hff = render_from_custom_template "_#{name}_input", rails_form @@ -216,11 +218,11 @@ opt << " selected=\"selected\"" end opt << ">#{text}</option>" }.join("\n") @action_view.select_tag( - "search[#{name}(comparator)]", option_tags + "search[#{name}(comparator)]", @action_view.raw(option_tags) ) end def comparator_opts [ @@ -336,37 +338,26 @@ set_instance_variables_from_options(admin_assistant, opts) end end def check_box_and_hidden_tags(input_name, value) - # Rails 2.3 wants the hidden tag to come before the checkbox, but it's - # the opposite for Rails 2.2 and 2.1 - if RAILS_GEM_VERSION =~ /^2.3/ - @action_view.send(:hidden_field_tag, input_name, '0', :id => "#{input_name}_hidden") + - @action_view.send(:check_box_tag, input_name, '1', value) - else - @action_view.send(:check_box_tag, input_name, '1', value) + - @action_view.send(:hidden_field_tag, input_name, '0', :id => "#{input_name}_hidden") - end + @action_view.send(:hidden_field_tag, input_name, '0', :id => "#{input_name}_hidden") + + @action_view.send(:check_box_tag, input_name, '1', value) end def controller @action_view.controller end def custom_template_file_path(slug) File.join( - RAILS_ROOT, 'app/views', controller.controller_path, + Rails.root, 'app/views', controller.controller_path, "#{slug}.html.erb" ) end def file_option_for_custom_template_render(slug) - if RAILS_GEM_VERSION == '2.1.0' - File.join(controller.controller_path, "#{slug}.html.erb") - else - custom_template_file_path slug - end + custom_template_file_path slug end def label if @label @label