# How is this done with REST (blinksale account)?

**URL:** <https://www.ruby-forum.com/t/how-is-this-done-with-rest-blinksale-account/89112>\
**Category:** Rails\
**Created:** [March 17, 2007, 11:21am UTC](https://www.ruby-forum.com/t/how-is-this-done-with-rest-blinksale-account/89112 "2007-03-17T11:21:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [March 17, 2007, 11:21am UTC](https://www.ruby-forum.com/t/how-is-this-done-with-rest-blinksale-account/89112/1 "2007-03-17T11:21:50Z")

</div>

In Blinksale, the settings link in the top right takes you to the /  
account url. From there, the side nav takes you to /account;templates /  
account;reminders , etc.

> From what I’ve read, ;templates and ;reminders are custom rest actions  
> for a given resource. But the controller (account) does not appear to  
> be of rest nature. Also, when creating a new account, the url is /  
> firms/new . When in /account controller it is also accessing the Firm  
> model/object.  
> Anyone know what I’m getting wrong here? Thanks.

---

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [March 18, 2007, 8:26pm UTC](https://www.ruby-forum.com/t/how-is-this-done-with-rest-blinksale-account/89112/2 "2007-03-18T20:26:07Z")

</div>

Anyone?

---

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [March 19, 2007, 6:19am UTC](https://www.ruby-forum.com/t/how-is-this-done-with-rest-blinksale-account/89112/3 "2007-03-19T06:19:57Z")

</div>

It is very likely that when you see a route that looks like  
account;templates that the app is exposing “templates” as a RESTful  
custom collection action:

map.resources :account, :collection =\> { :templates =\> :any }

It’s sounds like with Blinksale the Firm model is an account that the  
Blinksale customer signs up for and the Account model is the firm’s  
clients. If this is correct then their routing scheme makes sense.  
When you signup for an account with Blinksale you are creating a firm  
with the route: firm/new. This is RESTful too so I don’t think you  
are getting anything wrong here…

–  
Zack C.  
[http://depixelate.com](http://depixelate.com)

---

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [March 19, 2007, 7:22pm UTC](https://www.ruby-forum.com/t/how-is-this-done-with-rest-blinksale-account/89112/4 "2007-03-19T19:22:19Z")

</div>

Thank you for your reply. Isn’t collection a collections of resources/  
objects? It looks like to me that all those templates when submitted  
are issuing the http verb of put, which is updating one Firm object.  
Also, when you go to change your plan here is the url:  
[https://myname.blinksale.com/firms/50329;change\_plan?plan=Silver](https://myname.blinksale.com/firms/50329;change_plan?plan=Silver)  
So it appears to me that its kind of like a masking effect. /  
account;template is a mask for /firms/50329;template which makes  
sense because their users don’t need to see the latter url. If all of  
this is the case, how would one create that url scheme in the routes  
file? I remember I tried something like this but it didn’t work:

map.resources :accounts, :member =\> {:contact\_info =\> :put,  
:thank\_you  
=\> :put }

map.account ‘/account’, :controller =\> ‘accounts’

I thought this might generate /account;contact\_info
