mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-02 15:28:50 +01:00
move to strong_parameters of rails4.
This commit is contained in:
parent
049296fd33
commit
671f64b419
24 changed files with 153 additions and 61 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue