Class: Teaspoon::Bundle::BundleController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/teaspoon/bundle/bundle_controller.rb

Instance Method Summary collapse

Instance Method Details

#serveObject



3
4
5
6
7
8
9
# File 'app/controllers/teaspoon/bundle/bundle_controller.rb', line 3

def serve
  file = File.join(Teaspoon::Bundle.dir, "teaspoon_bundle_#{params[:suite]}.js.erb")
  File.write(file, contents)

  asset = Rails.application.assets.find_asset(file)
  render js: asset.to_s
end