sample view for the project

This commit is contained in:
Timothy N. Tsvetkov 2011-03-10 17:20:09 +03:00
parent df52b37acb
commit a373af936b
3 changed files with 14 additions and 1 deletions

View File

@ -1,11 +1,15 @@
class ProjectsController < ApplicationController
before_filter :authenticate_user!
before_filter :find_platform
before_filter :find_project, :only => [:show]
def new
@project = @platform.projects.new
end
def show
end
def create
@project = @platform.projects.new params[:project]
if @project.save
@ -22,4 +26,8 @@ class ProjectsController < ApplicationController
def find_platform
@platform = Platform.find params[:platform_id]
end
def find_project
@project = @platform.projects.find params[:id]
end
end

View File

@ -0,0 +1,3 @@
%h1= @project.name
= link_to "git-repo", platform_project_repo_path(@platform, @project)

View File

@ -2,7 +2,9 @@ Rosa::Application.routes.draw do
devise_for :users
resources :platforms do
resources :projects
resources :projects do
resource :repo, :controller => "git/repositories", :only => [:show]
end
end
resources :users