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

23 lines
492 B
Ruby
Raw Normal View History

2014-02-18 09:28:04 +01:00
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
2014-02-18 09:28:04 +01:00
private
def begin_of_association_chain
@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