Feature your models on your site's special spots.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
generators
lib
shoulda_macros
test
MIT-LICENSE
README.rdoc
Rakefile
init.rb

README.rdoc

acts_as_featured

Feature your models on your site's special spots.

(Tested only on Rails 2.3.2 as of now)

Setup

Install the plugin:

script/plugin install git://github.com/sgt/acts_as_featured.git Add the features table to your database:

script/generate acts_as_featured_migration rake db:migrate

Usage

In the model:

class Article < ActiveRecord::Base acts_as_featured end

Assigning models to feature spots:

article = Article.create(:subject=>'foo', :body=>'bar') # Assign the article to a feature spot (removes previous) article.feature_at! :top_right_spot

Getting the featured object:

@article = Article.featured_at :top_right_spot

Or directly in the view:

<% feature :top_spot do |f| %> <%= link_to f, f.name %> <% end %>