Class: Liquidum::ConversionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Liquidum::ConversionsController
- Defined in:
- app/controllers/liquidum/conversions_controller.rb
Defined Under Namespace
Classes: Conversion
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/liquidum/conversions_controller.rb', line 12 def create if params[:json_to_yaml] == 'commit' @conversion.result = YAML.dump(JSON.parse(@conversion.source)) elsif params[:yaml_to_json] == 'commit' @conversion.result = JSON.pretty_generate(Psych.load(@conversion.source)) elsif params[:slim_to_html] == 'commit' @conversion.result = Slim::Template.new({ pretty: true }) { @conversion.source }.render end render :index, status: 302 end |
#index ⇒ Object
10 |
# File 'app/controllers/liquidum/conversions_controller.rb', line 10 def index; end |