Class: DatashiftJourney::FormsController
- Inherits:
-
ActionController::API
- Object
- ActionController::API
- DatashiftJourney::FormsController
- Includes:
- ErrorRenderer
- Defined in:
- app/controllers/datashift_journey/page_states_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#index ⇒ Object
PageState contains details for rendering and storing a Page related to a single State.
- #show ⇒ Object
Methods included from ErrorRenderer
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/datashift_journey/page_states_controller.rb', line 16 def create @collector_form = Collector::FormDefinition.new(page_state_params) if @collector_form.save render json: @collector_form, status: :created else render_error(@collector_form, :unprocessable_entity) and return #render json: { errors: @collector_form.errors }, status: :unprocessable_entity end end |
#index ⇒ Object
PageState contains details for rendering and storing a Page related to a single State
10 11 12 13 14 |
# File 'app/controllers/datashift_journey/page_states_controller.rb', line 10 def index @collector_forms = Collector::FormDefinition.all render json: @collector_forms, status: :ok end |
#show ⇒ Object
27 28 29 |
# File 'app/controllers/datashift_journey/page_states_controller.rb', line 27 def show render json: @collector_form end |