Feature your models on your site’s special spots.
(Tested only on Rails 2.3.2 as of now)
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
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 %>