Class: PrioritiesController
Instance Method Summary
collapse
#footer_menu, #home_page, #page_title
Instance Method Details
#create ⇒ Object
23
24
25
26
27
28
29
30
31
32
|
# File 'app/controllers/priorities_controller.rb', line 23
def create
@priority = Priority.new(params[:priority])
@priority[:rank]=(params[:priority][:rank])
if @priority.save
flash[:notice] = 'Priority was successfully created.'
redirect_to :action => 'list'
else
render :action => 'new'
end
end
|
#destroy ⇒ Object
48
49
50
51
|
# File 'app/controllers/priorities_controller.rb', line 48
def destroy
Priority.find(params[:id]).destroy
redirect_to :action => 'list'
end
|
#edit ⇒ Object
34
35
36
|
# File 'app/controllers/priorities_controller.rb', line 34
def edit
@priority = Priority.find(params[:id])
end
|
#index ⇒ Object
2
3
4
5
|
# File 'app/controllers/priorities_controller.rb', line 2
def index
list
render :action => 'list'
end
|
#list ⇒ Object
11
12
13
|
# File 'app/controllers/priorities_controller.rb', line 11
def list
@priority_pages, @priorities = paginate :priorities, :per_page => 10
end
|
#new ⇒ Object
19
20
21
|
# File 'app/controllers/priorities_controller.rb', line 19
def new
@priority = Priority.new
end
|
#show ⇒ Object
15
16
17
|
# File 'app/controllers/priorities_controller.rb', line 15
def show
@priority = Priority.find(params[:id])
end
|
#update ⇒ Object
38
39
40
41
42
43
44
45
46
|
# File 'app/controllers/priorities_controller.rb', line 38
def update
@priority = Priority.find(params[:id])
if @priority.update_attributes(params[:priority])
flash[:notice] = 'Priority was successfully updated.'
redirect_to :action => 'show', :id => @priority
else
render :action => 'edit'
end
end
|