2014-02-18 09:28:04 +01:00
|
|
|
class NotesController < InheritedResources::Base
|
2014-03-06 21:49:30 +01:00
|
|
|
belongs_to :moderation
|
|
|
|
|
|
|
|
def create
|
|
|
|
create! do |format|
|
|
|
|
format.html {
|
|
|
|
@note.author = current_user
|
2014-03-07 22:21:52 +01:00
|
|
|
create!(notice: t(:added, scope: [:notes, :actions])) { moderations_url }
|
2014-03-06 21:49:30 +01:00
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
2014-02-18 09:28:04 +01:00
|
|
|
|
|
|
|
private
|
|
|
|
def begin_of_association_chain
|
2014-03-06 21:49:30 +01:00
|
|
|
@moderation = Event.unscoped.find params[:moderation_id]
|
|
|
|
@event = @moderation
|
2014-02-18 09:28:04 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def permitted_params
|
|
|
|
params.permit note: [:contents]
|
|
|
|
end
|
|
|
|
end
|