2 ms·
I use the controller mixin approach. My controller has two public methods: event and save_record. This is how they are used: def create event(:create
by epochwolf 15y ago
I use the controller mixin approach. My controller has two public methods: event and save_record. This is how they are used:
def create
event(:create, @literature, :notify => current_user.follows_by.users(:literature)) unless params[:skip_event]
if save_record @literature, &set_creator
redirect @literature , :notice => "Literature was created."
else
render_form
end
end
Here's the code: https://gist.github.com/1120260 https://gist.github.com/1120260