Class: Tramway::HasAndBelongsToManyRecordsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Tramway::HasAndBelongsToManyRecordsController
- Defined in:
- app/controllers/tramway/has_and_belongs_to_many_records_controller.rb
Instance Method Summary collapse
Methods included from RecordRoutesHelper
#edit_record_path, #new_record_path, #record_path, #records_path
Methods included from Filtering
#date_filter, #filtering, #list_filtering, #list_filtering_dates, #list_filtering_select
Methods included from AuthManagement
#authenticate_user!, #current_user, #sign_in, #sign_out, #signed_in?
Methods included from ClassNameHelpers
#decorator_class_name, #form_class_name, #model_class_name
Instance Method Details
#create ⇒ Object
4 5 6 7 8 9 |
# File 'app/controllers/tramway/has_and_belongs_to_many_records_controller.rb', line 4 def create base_object = model_class.find params[:object_id] @record_form = form_class.new base_object @sending_params = params[params[:model_class].underscore] || params[form_class.associated_as] redirect_to path end |
#destroy ⇒ Object
11 12 13 14 15 |
# File 'app/controllers/tramway/has_and_belongs_to_many_records_controller.rb', line 11 def destroy base_object = model_class.find params[:object_id] @record_form = params[:form].constantize.new base_object redirect_to path end |