Class: TagGroupsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- TagGroupsController
- Defined in:
- app/controllers/tag_groups_controller.rb
Overview
This class is the controller for Tag Groups, which are basically used to record the grouping of a set of Sequencing Tags. It allows you to create and view Tag Groups.
Constant Summary
Constants included from FlashTruncation
FlashTruncation::STRING_OVERHEAD
Instance Method Summary collapse
-
#create ⇒ Object
The create method uses a form object to validate the user input of the oligo sequences and handle the creation of Tags within a new Tag Group.
- #index ⇒ Object
-
#new ⇒ Object
The new method uses a form object to handle the naming of the Tag Group and the input and validation of the Tag oligo sequences.
- #show ⇒ Object
- #tag_group_form_object_params ⇒ Object
Methods inherited from ApplicationController
#block_api_access, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!
Methods included from FlashTruncation
#max_flash_size, #truncate_flash, #truncate_flash_array
Instance Method Details
#create ⇒ Object
The create method uses a form object to validate the user input of the oligo sequences and handle the creation of Tags within a new Tag Group.
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/tag_groups_controller.rb', line 32 def create @form_object = TagGroup::FormObject.new(tag_group_form_object_params) respond_to do |format| if @form_object.save flash[:notice] = 'Tag Group was successfully created.' format.html { redirect_to(@form_object.tag_group) } else format.html { render action: 'new' } end end end |
#index ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/tag_groups_controller.rb', line 8 def index @tag_groups = TagGroup.includes(:adapter_type) respond_to { |format| format.html } end |
#new ⇒ Object
The new method uses a form object to handle the naming of the Tag Group and the input and validation of the Tag oligo sequences.
23 24 25 26 27 |
# File 'app/controllers/tag_groups_controller.rb', line 23 def new @form_object = TagGroup::FormObject.new respond_to { |format| format.html } end |
#show ⇒ Object
14 15 16 17 18 |
# File 'app/controllers/tag_groups_controller.rb', line 14 def show @tag_group = TagGroup.find(params[:id]) respond_to { |format| format.html } end |
#tag_group_form_object_params ⇒ Object
45 46 47 |
# File 'app/controllers/tag_groups_controller.rb', line 45 def tag_group_form_object_params params.require(:tag_group).permit(:name, :oligos_text, :adapter_type_id) end |