Class: ThinkFeelDoDashboard::SocialNetworking::ProfileQuestionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb

Overview

Allows for the creation, updating, and deletion of social networking profile questions

Instance Method Summary collapse

Instance Method Details

#createObject



16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb', line 16

def create
  @profile_question = @group.profile_questions
                            .build(profile_question_params)
  if @profile_question.save
    redirect_to group_social_networking_profile_questions_path(@group),
                notice: "Profile Question was successfully created."
  else
    render :new
  end
end

#destroyObject



43
44
45
46
47
48
49
50
51
# File 'app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb', line 43

def destroy
  if @profile_question.destroy
    redirect_to group_social_networking_profile_questions_path(@group),
                notice: "Profile Question was successfully removed."
  else
    redirect_to group_social_networking_profile_questions_path(@group),
                alert: "There were errors."
  end
end

#editObject



31
32
# File 'app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb', line 31

def edit
end

#indexObject



11
12
13
14
# File 'app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb', line 11

def index
  @profile_questions = ::SocialNetworking::ProfileQuestion
                       .where(group_id: params[:group_id])
end

#newObject



27
28
29
# File 'app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb', line 27

def new
  @profile_question = ::SocialNetworking::ProfileQuestion.new
end

#updateObject



34
35
36
37
38
39
40
41
# File 'app/controllers/think_feel_do_dashboard/social_networking/profile_questions_controller.rb', line 34

def update
  if @profile_question.update(profile_question_params)
    redirect_to group_social_networking_profile_questions_path(@group),
                notice: "Profile Question was successfully updated."
  else
    render :edit
  end
end