mirror of
https://github.com/danbee/slugtastic
synced 2025-03-04 08:49:05 +00:00
93 lines
3.0 KiB
HTML
93 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset='utf-8'>
|
|
<meta http-equiv="X-UA-Compatible" content="chrome=1">
|
|
<link href='https://fonts.googleapis.com/css?family=Chivo:900' rel='stylesheet' type='text/css'>
|
|
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
|
|
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
|
|
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
|
|
<!--[if lt IE 9]>
|
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
<![endif]-->
|
|
<title>Slugtastic by danbee</title>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="container">
|
|
<div class="inner">
|
|
|
|
<header>
|
|
<h1>Slugtastic</h1>
|
|
<h2>A simple slug generator for Rails.</h2>
|
|
</header>
|
|
|
|
<section id="downloads" class="clearfix">
|
|
<a href="https://github.com/danbee/slugtastic/zipball/master" id="download-zip" class="button"><span>Download .zip</span></a>
|
|
<a href="https://github.com/danbee/slugtastic/tarball/master" id="download-tar-gz" class="button"><span>Download .tar.gz</span></a>
|
|
<a href="https://github.com/danbee/slugtastic" id="view-on-github" class="button"><span>View on GitHub</span></a>
|
|
</section>
|
|
|
|
<hr>
|
|
|
|
<section id="main_content">
|
|
<h1>Slugtastic</h1>
|
|
|
|
<p>Simple gem for autogenerating permalink style slugs for your ActiveRecord models.</p>
|
|
|
|
<h2>Requirements</h2>
|
|
|
|
<ul>
|
|
<li>Ruby 1.9.2 or 1.9.3</li>
|
|
<li>Rails 3.1 or higher.</li>
|
|
</ul><p>It should work with Rails 3.0 but it hasn't been tested.</p>
|
|
|
|
<h2>Installation</h2>
|
|
|
|
<p>Add this line to your application's Gemfile:</p>
|
|
|
|
<pre><code>gem 'slugtastic'
|
|
</code></pre>
|
|
|
|
<p>And then execute:</p>
|
|
|
|
<pre><code>$ bundle
|
|
</code></pre>
|
|
|
|
<p>Or install it yourself as:</p>
|
|
|
|
<pre><code>$ gem install slugtastic
|
|
</code></pre>
|
|
|
|
<h2>Usage</h2>
|
|
|
|
<p>Usage is very simple. Just add the following to your model:</p>
|
|
|
|
<pre><code>has_slug :slug, :from => :title
|
|
</code></pre>
|
|
|
|
<p>This will generate a slug string from the title atrribute and store it in the slug attribute unless the slug already contains a string. The slug is generated pre-validation so you can still use <code>validates_presence_of :slug</code>.</p>
|
|
|
|
<p>There are no extra options at present.</p>
|
|
|
|
<h2>Contributing</h2>
|
|
|
|
<ol>
|
|
<li>Fork it</li>
|
|
<li>Create your feature branch (<code>git checkout -b my-new-feature</code>)</li>
|
|
<li>Commit your changes (<code>git commit -am 'Added some feature'</code>)</li>
|
|
<li>Push to the branch (<code>git push origin my-new-feature</code>)</li>
|
|
<li>Create new Pull Request</li>
|
|
</ol>
|
|
</section>
|
|
|
|
<footer>
|
|
Slugtastic is maintained by <a href="https://github.com/danbee">danbee</a><br>
|
|
This page was generated by <a href="http://pages.github.com">GitHub Pages</a>. Tactile theme by <a href="http://twitter.com/jasonlong">Jason Long</a>.
|
|
</footer>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |