You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
11 years ago | |
---|---|---|
lib | 11 years ago | |
.gitignore | 11 years ago | |
Gemfile | 11 years ago | |
LICENSE.txt | 11 years ago | |
README.md | 11 years ago | |
Rakefile | 11 years ago | |
formtastic-slug.gemspec | 11 years ago |
README.md
Add a slug field, that generates a slug based on another field.
= semantic_form_for @blog_entry do |f|
= f.input :title
= f.input :slug, :as => :slug, :based_on => :title
You can put in the list of existing slugs and the editor will avoid using those:
= semantic_form_for @blog_entry do |f|
= f.input :title
= f.input :slug, :as => :slug, :based_on => :title, :existing_slugs => @blog_entry.class.slugs
Just add it to your Gemfile:
gem 'formtastic-slug', :git => 'git://github.com/johnbintz/formtastic-slug.git'