Displaying 1 result from an estimated 1 matches for "departments_controller".
2006 Aug 14
1
Rest, routes, path_prefix and default params
....connect '':controller/:action/:id'', :id => nil, :action => ''index''
end
in application.rb, I have
class ApplicationController < ActionController::Base
protected
def find_company
@company = Company.find(params[:company_id])
end
end
And in departments_controller.rb
class DepartmentsControler < ActionController::Base
before_filter :find_company
end
In companies_controller.rb
I have
class CompaniesController < ActionController::Base
protected
def find_company
@company = Company.find(params[:id])
end
end
-------------- next part -------...