Class: Heart::ImagesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Heart::ImagesController
- Defined in:
- app/controllers/heart/images_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'app/controllers/heart/images_controller.rb', line 5 def create image = Heart::Image.new image.dashboard_id = params[:dashboard_id] image.purpose = params[:purpose] image.dataurl = params[:dataurl] image.save render :json => { :result => 'success', :id => image.id } end |
#show ⇒ Object
14 15 16 17 |
# File 'app/controllers/heart/images_controller.rb', line 14 def show image = Heart::Image.find(params[:id]) send_data Base64.decode64(image.dataurl.split(",")[1]), :type => 'image/png', :disposition => 'inline' end |