Class: Bushido::EnvsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Bushido::EnvsController
- Defined in:
- app/controllers/bushido/envs_controller.rb
Instance Method Summary collapse
-
#update ⇒ Object
PUT /bushido/envs/:id.
Instance Method Details
#update ⇒ Object
PUT /bushido/envs/:id
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/bushido/envs_controller.rb', line 4 def update if ENV["BUSHIDO_APP_KEY"] != params[:key] or params[:id] == "BUSHIDO_KEY" respond_to do |format| format.html { render :layout => false, :text => true, :status => :forbidden } format.json { render :status => :unprocessable_entity } end else var = params[:id].upcase ENV[var] = params[:value] @value = ENV[var] respond_to do |format| if @value != ENV[var] format.html{render :layout => false, :text => true, :status => :unprocessable_entity} format.json{render :status => :unprocessable_entity} else Bushido::Data.fire(var, {var => ENV[var]}) format.html{render :text => true} format.json{render :json => {var => ENV[var]}} end end end end |