Хорошо, это немного яснее.
ответ заключается в том, что вы можете добавить методы к контроллерам, которые можно использовать в нескольких действиях, например:
class Admin::ReportsController < ApplicationController
def update
@objects = get_objects
respond_to do |format|
format.html #index.html.erb
end
end
def import
@objects = get_objects
respond_to do |format|
format.html #index.html.erb
end
end
# using protected means that the methods below here won't be recognised as new actions
protected
def get_objects
unless params[:my_objects].present?
flash[:notice] = "no objects!"
return redirect_to(:action => :index)
end
objects = []
params[:objects].each do |obj|
objects << object.new(obj)
end
objects
end