Class: FunctionalSetsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/functional_sets_controller.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#footer_menu, #home_page

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
# File 'app/controllers/functional_sets_controller.rb', line 19

def create
  @functional_set = FunctionalSet.new(params[:functional_set])
  if @functional_set.save
    flash[:notice] = 'FunctionalSet was successfully created.'
    redirect_to :action => 'list'
  else
    render :action => 'new'
  end
end

#destroyObject



43
44
45
46
# File 'app/controllers/functional_sets_controller.rb', line 43

def destroy
  FunctionalSet.find(params[:id]).destroy
  redirect_to :action => 'list'
end

#editObject



29
30
31
# File 'app/controllers/functional_sets_controller.rb', line 29

def edit
  @functional_set = FunctionalSet.find(params[:id])
end

#indexObject



6
7
8
9
# File 'app/controllers/functional_sets_controller.rb', line 6

def index
  list
  render :action => 'list'
end

#listObject



11
12
13
# File 'app/controllers/functional_sets_controller.rb', line 11

def list
  @functional_set_pages, @functional_sets = paginate :functional_sets, :per_page => 10
end

#newObject



15
16
17
# File 'app/controllers/functional_sets_controller.rb', line 15

def new
  @functional_set = FunctionalSet.new
end

#page_titleObject



48
49
50
51
52
53
54
# File 'app/controllers/functional_sets_controller.rb', line 48

def page_title
  if ('list' == action_name())
    "Functional Sets"
  else
    "#{action_name()} Functional Set"
  end
end

#updateObject



33
34
35
36
37
38
39
40
41
# File 'app/controllers/functional_sets_controller.rb', line 33

def update
  @functional_set = FunctionalSet.find(params[:id])
  if @functional_set.update_attributes(params[:functional_set])
    flash[:notice] = 'FunctionalSet was successfully updated.'
    redirect_to :action => 'show', :id => @functional_set
  else
    render :action => 'edit'
  end
end