Skip to content

sgt/acts_as_featured

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 %>

About

Feature your models on your site's special spots.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages