Module: Spree::Api::Responders::RablTemplate
- Included in:
- AppResponder
- Defined in:
- lib/spree/api/responders/rabl_template.rb
Instance Method Summary collapse
Instance Method Details
#api_behavior ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/spree/api/responders/rabl_template.rb', line 19 def api_behavior if controller.params[:action] == "destroy" # Render a blank template super else # Do nothing and fallback to the default template end end |
#template ⇒ Object
15 16 17 |
# File 'lib/spree/api/responders/rabl_template.rb', line 15 def template [:default_template] end |
#to_format ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/spree/api/responders/rabl_template.rb', line 5 def to_format if template render template, :status => [:status] || 200 else super end rescue ActionView::MissingTemplate => e api_behavior end |