# \[ANN\] Restflection Plugin

**URL:** <https://www.ruby-forum.com/t/ann-restflection-plugin/105749>\
**Category:** Rails\
**Created:** [June 2, 2007, 2:07am UTC](https://www.ruby-forum.com/t/ann-restflection-plugin/105749 "2007-06-02T02:07:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![turnip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b77776/32.png) [@turnip](https://www.ruby-forum.com/u/turnip)\
**Post date:** [June 2, 2007, 2:07am UTC](https://www.ruby-forum.com/t/ann-restflection-plugin/105749/1 "2007-06-02T02:07:46Z")

</div>

"Restflection is a Ruby on Rails plugin designed for use in applications  
which follow RESTful conventions. It allows you to extract information  
about resources without necessarily knowing what they are called.

For example, instead of writing article\_path, you could write  
restflect(:member).path. Why would you do this? You may have shared  
code, for instance layouts or library files, which need to make use of a  
resource, but because they operate on any number of different resources,  
they cannot refer to them by name. The plugin could also be of use to  
other plugins."

Blog post: [http://jonathanleighton.com/blog/restflection-rails-plugin](http://jonathanleighton.com/blog/restflection-rails-plugin)  
Documentation: [http://jonathanleighton.com/projects/restflection](http://jonathanleighton.com/projects/restflection)

Feedback is always welcome.

Jon

---

<div class="post-metadata">

**Author:** ![turnip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b77776/32.png) [@turnip](https://www.ruby-forum.com/u/turnip)\
**Post date:** [June 2, 2007, 3:52pm UTC](https://www.ruby-forum.com/t/ann-restflection-plugin/105749/2 "2007-06-02T15:52:47Z")

</div>

Jon,  
You seem very enlightened in the RESTful world. If appropriate I’d  
like to ask you a question.  
I’ve got a VERY nested Rails application that will often call tables 4  
or five levels deep. For example  
LevelFiveTable\_path(@tableone.tabletwo.tablethree, (you get the  
picture).find(tablefive:params)  
Is there a way to make this look prettier?  
Thanks,  
David

On Jun 1, 7:07 pm, Jon L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![turnip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b77776/32.png) [@turnip](https://www.ruby-forum.com/u/turnip)\
**Post date:** [June 2, 2007, 4:33pm UTC](https://www.ruby-forum.com/t/ann-restflection-plugin/105749/3 "2007-06-02T16:33:57Z")

</div>

BraveDave wrote:

> I’ve got a VERY nested Rails application that will often call tables 4  
> or five levels deep. For example  
> LevelFiveTable\_path(@tableone.tabletwo.tablethree, (you get the  
> picture).find(tablefive:params)  
> Is there a way to make this look prettier?

No idea really, especially without knowing the context of your app. You  
might find this helpful though:  
[http://weblog.jamisbuck.org/2007/2/5/nesting-resources](http://weblog.jamisbuck.org/2007/2/5/nesting-resources)
