我的問題是關於爲我的簡單的應用程序做路由和控制器的正確方法。老實說,我被User模型和Post模型卡住了。 我知道了路由這樣的: match '/dashboard', to: 'dashboard#user'
在控制器需要會話UID來查找用戶和他的職位(職位和用戶配置文件是完全私有的用戶)。到目前爲止,儀表板爲其目的服務。問題是我從哪裏出發?帖子與帖子列表顯示在相同的視圖中。爲了編輯/更新和
我有兩種模型:Schedule和Project。計劃belongs_To項目和項目has_one計劃。對進度和項目的路線嵌套這樣的: get 'projects/current', to: 'projects#show_current', as: :current_freelancer_projects
resources :projects do
resources :schedul
我已經在路線如下: resources :projects do
resources :schedules
end
我想去看演出時間表頁面。耙路線列出了這一點: project_schedule GET /projects/:project_id/schedules/:id(.:format) schedules#show
我有以下的其他頁面上的鏈接時間表#顯示頁面: <%=