move to strong_parameters of rails4.

This commit is contained in:
Reinier Balt 2013-05-27 12:44:31 +02:00
parent 049296fd33
commit 671f64b419
24 changed files with 153 additions and 61 deletions

View file

@ -24,7 +24,7 @@ class NotesController < ApplicationController
def create
@note = current_user.notes.build
@note.attributes = params["note"]
@note.attributes = note_params
@saved = @note.save
@ -45,7 +45,7 @@ class NotesController < ApplicationController
def update
@note = current_user.notes.find(params['id'])
@note.attributes = params["note"]
@note.attributes = note_params
@saved = @note.save
respond_to do |format|
format.html
@ -69,4 +69,10 @@ class NotesController < ApplicationController
@source_view = params['_source_view'] || 'note'
end
private
def note_params
params.require(:note).permit(:project_id, :body)
end
end