Home > Software engineering >  Ruby on Rails (Redmine) add route
Ruby on Rails (Redmine) add route

Time:08-07

Please help me add the custom route in format:

/projects/any-project-name/estimated_time/report

controller: estimatedtime

method: report

routes.rb

Rails.application.routes.draw do
  root :to => 'welcome#index', :as => 'home'
.....
  get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt'
  get '/issues/gantt', :to => 'gantts#show'

.....
resources :time_entries, :controller => 'timelog', :except => [:show, :edit, :update, :destroy] do
      get 'report', :on => :collection
    end
.....
 resources :time_entries, :controller => 'timelog', :only => [:new, :create]
.....
end

CodePudding user response:

Try this out: get 'projects/:project_name_attribute/estimated_time/report' => 'estimatedtimes#report'

  • Related