Class: Gatherable::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Gatherable::ApplicationController
- Defined in:
- app/controllers/gatherable/application_controller.rb,
lib/generators/gatherable/templates/application_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 |
# File 'app/controllers/gatherable/application_controller.rb', line 9 def create render :json => model_class.create(model_params), :status => :created rescue ActionController::ParameterMissing => e render :json => { :errors => e.}, :status => :unprocessable_entity end |
#show ⇒ Object
3 4 5 6 7 |
# File 'app/controllers/gatherable/application_controller.rb', line 3 def show render :json => model_class.find(params[model_id]), :status => :found rescue ActiveRecord::RecordNotFound => e render :json => { :errors => e.}, :status => :not_found end |