diff options
| author | Michel Etienne | 2012-03-20 11:59:27 +0100 | 
|---|---|---|
| committer | Michel Etienne | 2012-03-20 11:59:27 +0100 | 
| commit | 2011ee0247deede4a58dbdcc6f5c50146dedf584 (patch) | |
| tree | 01bf481ed549e7025b5de5416ed64eca513c25bf /app/controllers | |
| parent | 153c6f7022a608c6780b265d3b91c95829b192e4 (diff) | |
| download | chouette-core-2011ee0247deede4a58dbdcc6f5c50146dedf584.tar.bz2 | |
set conformance for line network and company screens with fields specifications
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/companies_controller.rb | 5 | ||||
| -rw-r--r-- | app/controllers/networks_controller.rb | 5 | 
2 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/companies_controller.rb b/app/controllers/companies_controller.rb index 2b13d78cf..20967f733 100644 --- a/app/controllers/companies_controller.rb +++ b/app/controllers/companies_controller.rb @@ -11,6 +11,11 @@ class CompaniesController < ChouetteController    # end    protected +  def collection     +    @q = referential.companies.search(params[:q]) +    @companies ||= @q.result(:distinct => true).order(:name).paginate(:page => params[:page], :per_page => 10) +  end +    def resource_url(company = nil)      referential_company_path(referential, company || resource) diff --git a/app/controllers/networks_controller.rb b/app/controllers/networks_controller.rb index b9423c976..e5c3e3ca7 100644 --- a/app/controllers/networks_controller.rb +++ b/app/controllers/networks_controller.rb @@ -6,6 +6,11 @@ class NetworksController < ChouetteController    protected +  def collection     +    @q = referential.networks.search(params[:q]) +    @networks ||= @q.result(:distinct => true).order(:name).paginate(:page => params[:page], :per_page => 10) +  end +    def resource_url(network = nil)      referential_network_path(referential, network || resource)    end  | 
