Class: AreasController
Instance Method Summary
collapse
included
#current_ability
#parent, #voluntary_application_javascripts, #voluntary_application_stylesheets
included
Instance Method Details
#create ⇒ Object
30
31
32
33
34
35
36
37
38
|
# File 'app/controllers/areas_controller.rb', line 30
def create
@area = Area.new(params[:area])
if @area.save
redirect_to @area, notice: t('general.form.successfully_created')
else
render :new
end
end
|
#destroy ⇒ Object
51
52
53
54
|
# File 'app/controllers/areas_controller.rb', line 51
def destroy
@area.destroy
redirect_to areas_url, notice: t('general.form.destroyed')
end
|
#edit ⇒ Object
40
41
|
# File 'app/controllers/areas_controller.rb', line 40
def edit
end
|
#index ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'app/controllers/areas_controller.rb', line 12
def index
@areas = Area.roots
respond_to do |format|
format.html
format.json { render json: @areas.tokens(params[:q]) }
end
end
|
#new ⇒ Object
26
27
28
|
# File 'app/controllers/areas_controller.rb', line 26
def new
@area = Area.new(params[:area])
end
|
#resource ⇒ Object
56
57
58
|
# File 'app/controllers/areas_controller.rb', line 56
def resource
@area
end
|
#show ⇒ Object
21
22
23
24
|
# File 'app/controllers/areas_controller.rb', line 21
def show
@areas = @area.children
@projects = @area.projects
end
|
#update ⇒ Object
43
44
45
46
47
48
49
|
# File 'app/controllers/areas_controller.rb', line 43
def update
if @area.update_attributes(params[:area])
redirect_to @area, notice: t('general.form.successfully_updated')
else
render :edit
end
end
|