Fixing requests after namespaces. Fixed admin bug with access to project

This commit is contained in:
Dmitriy Zaporozhets 2012-11-23 22:25:28 +02:00
parent e92b563acf
commit 0e1635a68a
14 changed files with 35 additions and 62 deletions

View file

@ -42,4 +42,14 @@ class Admin::ProjectsController < AdminController
redirect_to projects_url, notice: 'Project was successfully deleted.'
end
protected
def project
id = params[:project_id] || params[:id]
id = id.split("/") if id.include?("/")
@project ||= Project.find_by_path(id)
@project || render_404
end
end