Class: ProjectSuggestionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/project_suggestions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/project_suggestions_controller.rb', line 9

def create
  find_project
  @project_suggestions = @project.project_suggestions.build(user: current_user)
  if @project_suggestions.update_attributes(project_suggestion_params)
    flash[:notice] = "Thanks for the suggestion, we'll update the project shortly"
    redirect_to project_path(@project.to_param)
  else
    render :new
  end
end

#newObject


4
5
6
7
# File 'app/controllers/project_suggestions_controller.rb', line 4

def new
  find_project
  @project_suggestions = @project.project_suggestions.build(user: current_user)
end