This project rocks and uses MIT-LICENSE.
Install devise (or other authentication solution)
gem install devise rails generate devise:install rails generate devise User
Add to Gemfile
gem "updated_by", :git => 'git://github.com/lucasrenan/updated-by.git'
Run
bundle install
Creates the migration for table UpdatedActions
rails g updated_by_migration m
rails g scaffold post title:string content:text rake db:migrate
Add update_by to model Post
class Post < ActiveRecord::Base updated_by end
Add current_user to model User
class User < ActiveRecord::Base cattr_accessor :current_user end
<%- unless @post.created_by.nil? %>
criado por: <%= @post.created_by.user_name %>
<%- end %>
To get things working properly, it’s necessary that current_user is available and user is logged in.