@@ -17,7 +17,7 | |||||
17 |
|
17 | |||
18 | class BoardsController < ApplicationController |
|
18 | class BoardsController < ApplicationController | |
19 | default_search_scope :messages |
|
19 | default_search_scope :messages | |
20 | before_filter :find_project, :authorize |
|
20 | before_filter :find_project, :find_board_if_available, :authorize | |
21 |
|
21 | |||
22 | helper :messages |
|
22 | helper :messages | |
23 | include MessagesHelper |
|
23 | include MessagesHelper | |
@@ -90,6 +90,11 private | |||||
90 |
|
90 | |||
91 | def find_project |
|
91 | def find_project | |
92 | @project = Project.find(params[:project_id]) |
|
92 | @project = Project.find(params[:project_id]) | |
|
93 | rescue ActiveRecord::RecordNotFound | |||
|
94 | render_404 | |||
|
95 | end | |||
|
96 | ||||
|
97 | def find_board_if_available | |||
93 | @board = @project.boards.find(params[:id]) if params[:id] |
|
98 | @board = @project.boards.find(params[:id]) if params[:id] | |
94 | rescue ActiveRecord::RecordNotFound |
|
99 | rescue ActiveRecord::RecordNotFound | |
95 | render_404 |
|
100 | render_404 |
General Comments 0
You need to be logged in to leave comments.
Login now