# New blog application post slugs

**URL:** <https://www.ruby-forum.com/t/new-blog-application-post-slugs/137654>\
**Category:** Rails\
**Created:** [May 15, 2008, 12:58am UTC](https://www.ruby-forum.com/t/new-blog-application-post-slugs/137654 "2008-05-15T00:58:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [May 15, 2008, 12:58am UTC](https://www.ruby-forum.com/t/new-blog-application-post-slugs/137654/1 "2008-05-15T00:58:03Z")

</div>

Hello. I’m creating my own RESTful blog app. I am wondering about  
creating post slugs. I think Wordpress creates a slug at post  
creation time and stores the string in the database, then uses that  
for URLs.

I read about the acts\_as\_sluggable strategy (http://  
[agilewebdevelopment.com/plugins/acts\_as\_sluggable](http://agilewebdevelopment.com/plugins/acts_as_sluggable)) but I don’t like  
having a number (the ID) in the URL.

Any implementation tips from how Mephisto or typo does it? Is there  
anything wrong with creating a slug at creation time, is there a  
better way to do this? I’ll also be importing a Wordpress database  
with existing slugs.

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [May 15, 2008, 1:27am UTC](https://www.ruby-forum.com/t/new-blog-application-post-slugs/137654/2 "2008-05-15T01:27:52Z")

</div>

You can use permalink\_fu or stringex, the latter being my favourite. You  
can  
get it from [GitHub - rsl/stringex: Some [hopefully] useful extensions to Ruby’s String class. It is made up of three libraries: ActsAsUrl [permalink solution with better character translation], Unidecoder [Unicode to Ascii transliteration], and StringExtensions [miscellaneous helper methods for the String class].](http://www.github.com/rsl/stringex)

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [May 15, 2008, 4:41am UTC](https://www.ruby-forum.com/t/new-blog-application-post-slugs/137654/3 "2008-05-15T04:41:08Z")

</div>

Hi Ryan. It looks like stringexs creates excellent slugs, in fact I’m  
really impressed by the work being done converting dollars signs to  
words, converting chinese characters to english etc. So then to solve  
my problem you support creating a permalink/slug and storing that in  
my “posts” table?

On May 14, 6:26 pm, “Ryan B. (Radar)” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![andy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/aeb1de/32.png) [@andy](https://www.ruby-forum.com/u/andy)\
**Post date:** [May 15, 2008, 5:31am UTC](https://www.ruby-forum.com/t/new-blog-application-post-slugs/137654/4 "2008-05-15T05:31:24Z")

</div>

Yes.

On Thu, May 15, 2008 at 12:10 PM, Andy [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> can
> 
> > get it fromhttp://www.github.com/rsl/stringex

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

Feel free to add me to MSN and/or GTalk as this email.
