project layout
This commit is contained in:
parent
1ffb4b98c0
commit
487ae906a9
5 changed files with 71 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
|||
class ProjectsController < ApplicationController
|
||||
before_filter :project, :except => [:index, :new, :create]
|
||||
layout :determine_layout
|
||||
|
||||
# Authorize
|
||||
before_filter :add_project_abilities
|
||||
|
@ -152,4 +153,12 @@ class ProjectsController < ApplicationController
|
|||
def project
|
||||
@project ||= Project.find_by_code(params[:id])
|
||||
end
|
||||
|
||||
def determine_layout
|
||||
if @project && !@project.new_record?
|
||||
"project"
|
||||
else
|
||||
"application"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue