Module: Easy::Api::ControllerMethods::InstanceMethods
- Defined in:
- lib/easy/api/controller_methods.rb
Instance Method Summary collapse
-
#render_format ⇒ Object
Renders the Easy::Api::Result object in either json or html format (can be extended to include other formats).
-
#setup_result ⇒ Object
Initialises a new Easy::Api::Result object (@result) for your controller actions.
Instance Method Details
#render_format ⇒ Object
Renders the Easy::Api::Result object in either json or html format (can be extended to include other formats)
5 6 7 8 9 10 |
# File 'lib/easy/api/controller_methods.rb', line 5 def render_format respond_to do |format| format.html { render :status => @result.status_code } format.json { render :json => @result, :status => @result.status_code } end end |