Module: SessionEditingController
- Defined in:
- lib/rails-caddy/controllers/session_editing_controller.rb
Instance Method Summary collapse
Instance Method Details
#remove_session ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/rails-caddy/controllers/session_editing_controller.rb', line 12 def remove_session if params[:id].nil? render :status => 422, :text => "Invalid request. Session variable is either missing or invalid." return false end session[params[:id].to_sym] = nil render :status => 200, :nothing => true end |
#update_session ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/rails-caddy/controllers/session_editing_controller.rb', line 3 def update_session if params[:id].nil? render :status => 422, :text => "Invalid request. No session variable provided." return false end session[params[:id].to_sym] = params[:value] render :status => 200, :text => params[:value] end |