Class: ProjectInfosController

Inherits:
ApplicationController show all
Includes:
ProjectInfosHelper
Defined in:
app/controllers/project_infos_controller.rb

Instance Method Summary collapse

Methods included from ProjectInfosHelper

#project_info_exists

Methods included from ApplicationHelper

#footer_menu, #home_page, #page_title

Instance Method Details

#createObject



17
18
19
20
21
22
23
24
25
# File 'app/controllers/project_infos_controller.rb', line 17

def create
  @project_info = ProjectInfo.new(params[:project_info])
  if @project_info.save
    flash[:notice] = 'ProjectInfo was successfully created.'
    redirect_back_or_default(:controller => 'board', :action => 'index')
  else
    render :action => 'new'
  end
end

#editObject



27
28
29
# File 'app/controllers/project_infos_controller.rb', line 27

def edit
  @project_info = ProjectInfo.find(params[:id])
end

#indexObject



9
10
11
# File 'app/controllers/project_infos_controller.rb', line 9

def index
  @project_info = ProjectInfo.find(1)
end

#newObject



13
14
15
# File 'app/controllers/project_infos_controller.rb', line 13

def new
  @project_info = ProjectInfo.new
end

#updateObject



31
32
33
34
35
36
37
38
39
# File 'app/controllers/project_infos_controller.rb', line 31

def update
  @project_info = ProjectInfo.find(params[:id])
  if @project_info.update_attributes(params[:project_info])
    flash[:notice] = 'ProjectInfo was successfully updated.'
    redirect_back_or_default(:controller => 'board', :action => 'index')
  else
    render :action => 'edit'
  end
end