Class: ObservationMatrixColumnItemsController

Inherits:
ApplicationController show all
Includes:
DataControllerConfiguration::ProjectDataControllerConfiguration
Defined in:
app/controllers/observation_matrix_column_items_controller.rb

Instance Attribute Summary

Attributes inherited from ApplicationController

#is_data_controller, #is_task_controller, #meta_data, #meta_description, #meta_keywords, #meta_title, #page_title, #site_name

Instance Method Summary (collapse)

Methods included from DataControllerConfiguration::ProjectDataControllerConfiguration

#polymorphic_filter_params

Methods inherited from ApplicationController

#clear_project_and_user_variables, #digest_cookie, #digested_cookie_exists?, #disable_turbolinks, #intercept_api, #invalid_object, #is_data_controller?, #is_task_controller?, #log_user_recent_route, #notice_user, #project_matches, #record_not_found, #set_project_and_user_variables, #set_project_from_params, #token_authenticate

Methods included from ProjectsHelper

#project_link, #project_tag, #projects_list, #projects_search_form

Instance Method Details

- (Object) create

POST /observation_matrix_column_items POST /observation_matrix_column_items.json



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/controllers/observation_matrix_column_items_controller.rb', line 32

def create
  @observation_matrix_column_item = ObservationMatrixColumnItem.new(observation_matrix_column_item_params)

  respond_to do |format|
    if @observation_matrix_column_item.save
      format.html { redirect_to @observation_matrix_column_item.metamorphosize, notice: 'Matrix column item was successfully created.' }
      format.json { render :show, status: :created, location: @observation_matrix_column_item }
    else
      format.html { render :new }
      format.json { render json: @observation_matrix_column_item.errors, status: :unprocessable_entity }
    end
  end
end

- (Object) destroy

DELETE /observation_matrix_column_items/1 DELETE /observation_matrix_column_items/1.json



62
63
64
65
66
67
68
# File 'app/controllers/observation_matrix_column_items_controller.rb', line 62

def destroy
  @observation_matrix_column_item.destroy
  respond_to do |format|
    format.html { redirect_to observation_matrix_column_items_url, notice: 'Matrix column item was successfully destroyed.' }
    format.json { head :no_content }
  end
end

- (Object) edit

GET /observation_matrix_column_items/1/edit



27
28
# File 'app/controllers/observation_matrix_column_items_controller.rb', line 27

def edit
end

- (Object) index

GET /observation_matrix_column_items GET /observation_matrix_column_items.json



7
8
9
10
# File 'app/controllers/observation_matrix_column_items_controller.rb', line 7

def index
  @recent_objects = ObservationMatrixColumnItem.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)
  render '/shared/data/all/index'
end

- (Object) list



17
18
19
# File 'app/controllers/observation_matrix_column_items_controller.rb', line 17

def list
  @observation_matrix_column_items = ObservationMatrixColumnItem.with_project_id(sessions_current_project_id).page(params[:page])
end

- (Object) new

GET /observation_matrix_column_items/new



22
23
24
# File 'app/controllers/observation_matrix_column_items_controller.rb', line 22

def new
  @observation_matrix_column_item = ObservationMatrixColumnItem.new
end

- (Object) observation_matrix_column_item_params (private)

Never trust parameters from the scary internet, only allow the white list through.



77
78
79
# File 'app/controllers/observation_matrix_column_items_controller.rb', line 77

def observation_matrix_column_item_params
  params.require(:observation_matrix_column_item).permit(:observation_matrix_id, :type, :descriptor_id, :keyword_id)
end

- (Object) set_observation_matrix_column_item (private)

Use callbacks to share common setup or constraints between actions.



72
73
74
# File 'app/controllers/observation_matrix_column_items_controller.rb', line 72

def set_observation_matrix_column_item
  @observation_matrix_column_item = ObservationMatrixColumnItem.find(params[:id])
end

- (Object) show

GET /observation_matrix_column_items/1 GET /observation_matrix_column_items/1.json



14
15
# File 'app/controllers/observation_matrix_column_items_controller.rb', line 14

def show
end

- (Object) update

PATCH/PUT /observation_matrix_column_items/1 PATCH/PUT /observation_matrix_column_items/1.json



48
49
50
51
52
53
54
55
56
57
58
# File 'app/controllers/observation_matrix_column_items_controller.rb', line 48

def update
  respond_to do |format|
    if @observation_matrix_column_item.update(observation_matrix_column_item_params)
      format.html { redirect_to @observation_matrix_column_item.metamorphosize, notice: 'Matrix column item was successfully updated.' }
      format.json { render :show, status: :ok, location: @observation_matrix_column_item }
    else
      format.html { render :edit }
      format.json { render json: @observation_matrix_column_item.errors, status: :unprocessable_entity }
    end
  end
end