agenda-libre-ruby/app/controllers/notes_controller.rb

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: 'Dude! Nice job creating that note.') { 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