Class: MessageTemplatesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- MessageTemplatesController
- Defined in:
- app/controllers/message_templates_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /message_templates POST /message_templates.json.
-
#destroy ⇒ Object
DELETE /message_templates/1 DELETE /message_templates/1.json.
-
#edit ⇒ Object
GET /message_templates/1/edit.
-
#index ⇒ Object
GET /message_templates GET /message_templates.json.
-
#new ⇒ Object
GET /message_templates/new GET /message_templates/new.json.
-
#show ⇒ Object
GET /message_templates/1 GET /message_templates/1.json.
-
#update ⇒ Object
PUT /message_templates/1 PUT /message_templates/1.json.
Instance Method Details
#create ⇒ Object
POST /message_templates POST /message_templates.json
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'app/controllers/message_templates_controller.rb', line 42 def create = MessageTemplate.new() respond_to do |format| if .save format.html { redirect_to , notice: t('controller.successfully_created', model: t('activerecord.models.message_template')) } format.json { render json: , status: :created, location: } else format.html { render action: "new" } format.json { render json: .errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /message_templates/1 DELETE /message_templates/1.json
77 78 79 80 81 82 83 84 |
# File 'app/controllers/message_templates_controller.rb', line 77 def destroy .destroy respond_to do |format| format.html { redirect_to , notice: t('controller.successfully_deleted', model: t('activerecord.models.message_template')) } format.json { head :no_content } end end |
#edit ⇒ Object
GET /message_templates/1/edit
37 38 |
# File 'app/controllers/message_templates_controller.rb', line 37 def edit end |
#index ⇒ Object
GET /message_templates GET /message_templates.json
7 8 9 10 11 12 13 14 |
# File 'app/controllers/message_templates_controller.rb', line 7 def index = MessageTemplate.page(params[:page]) respond_to do |format| format.html # index.html.erb format.json { render json: } end end |
#new ⇒ Object
GET /message_templates/new GET /message_templates/new.json
27 28 29 30 31 32 33 34 |
# File 'app/controllers/message_templates_controller.rb', line 27 def new = MessageTemplate.new respond_to do |format| format.html # new.html.erb format.json { render json: } end end |
#show ⇒ Object
GET /message_templates/1 GET /message_templates/1.json
18 19 20 21 22 23 |
# File 'app/controllers/message_templates_controller.rb', line 18 def show respond_to do |format| format.html # show.html.erb format.json { render json: } end end |
#update ⇒ Object
PUT /message_templates/1 PUT /message_templates/1.json
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'app/controllers/message_templates_controller.rb', line 58 def update if params[:move] move_position(, params[:move]) return end respond_to do |format| if .update() format.html { redirect_to , notice: t('controller.successfully_updated', model: t('activerecord.models.message_template')) } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: .errors, status: :unprocessable_entity } end end end |