lib/admin_assistant/request/index.rb in admin_assistant-1.0.0 vs lib/admin_assistant/request/index.rb in admin_assistant-1.0.1
- old
+ new
@@ -1,26 +1,33 @@
class AdminAssistant
module Request
class Index < Base
def call
- controller_methods = {}
- possible_methods = [
- :conditions_for_index, :extra_right_column_links_for_index
- ]
- possible_methods.each do |mname|
- if @controller.respond_to?(mname)
- controller_methods[mname] = @controller.method mname
- end
- end
index = AdminAssistant::Index.new(
@admin_assistant, @controller.params, controller_methods
)
@controller.instance_variable_set :@index, index
+ if @controller.respond_to?(:before_render_for_index)
+ @controller.send :before_render_for_index
+ end
render_template_file
end
def columns
@admin_assistant.index_settings.columns
+ end
+
+ def controller_methods
+ c_methods = {}
+ possible_methods = [
+ :conditions_for_index, :extra_right_column_links_for_index
+ ]
+ possible_methods.each do |mname|
+ if @controller.respond_to?(mname)
+ c_methods[mname] = @controller.method mname
+ end
+ end
+ c_methods
end
end
end
end