Class: Gaku::Admin::TemplatesController
- Inherits:
-
BaseController
- Object
- CoreController
- BaseController
- Gaku::Admin::TemplatesController
- Defined in:
- app/controllers/gaku/admin/templates_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #download ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/gaku/admin/templates_controller.rb', line 15 def create @template = Template.new(template_params) if @template.save set_count respond_with @template else render :new end end |
#destroy ⇒ Object
44 45 46 47 48 |
# File 'app/controllers/gaku/admin/templates_controller.rb', line 44 def destroy @template.destroy set_count respond_with @template end |
#download ⇒ Object
34 35 36 |
# File 'app/controllers/gaku/admin/templates_controller.rb', line 34 def download send_file @template.file.path end |
#edit ⇒ Object
25 26 27 |
# File 'app/controllers/gaku/admin/templates_controller.rb', line 25 def edit respond_with @template end |
#index ⇒ Object
38 39 40 41 42 |
# File 'app/controllers/gaku/admin/templates_controller.rb', line 38 def index @templates = Template.all set_count respond_with @templates end |
#new ⇒ Object
11 12 13 |
# File 'app/controllers/gaku/admin/templates_controller.rb', line 11 def new @template = Template.new end |
#update ⇒ Object
29 30 31 32 |
# File 'app/controllers/gaku/admin/templates_controller.rb', line 29 def update @template.update(template_params) respond_with @template end |