23 lines
492 B
Ruby
23 lines
492 B
Ruby
class NotesController < InheritedResources::Base
|
|
belongs_to :moderation
|
|
|
|
def create
|
|
create! do |format|
|
|
format.html {
|
|
@note.author = current_user
|
|
create!(notice: t(:added, scope: [:notes, :actions])) { moderations_url }
|
|
}
|
|
end
|
|
end
|
|
|
|
private
|
|
def begin_of_association_chain
|
|
@moderation = Event.unscoped.find params[:moderation_id]
|
|
@event = @moderation
|
|
end
|
|
|
|
def permitted_params
|
|
params.permit note: [:contents]
|
|
end
|
|
end
|