This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is in application_controller but could be in a module | |
NON_FORM_PARAMS = [:id, :created_at, :updated_at] | |
def permitted_params(model) | |
model.column_names - NON_FORM_PARAMS | |
end | |
def nested_destroy(model) | |
permitted_params(model) + [:destroy, :id] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
feature "User edits ther review", %Q{ | |
As an author of a review | |
I want to be able to edit my review | |
} do | |
# Acceptance Criteria | |
# * Only the author of a review can edit a review | |
# * non-authors will not see a link to edit |