--
You received this message because you are subscribed to the Google Groups "Sammy.js" group.
To post to this group, send email to sam...@googlegroups.com.
To unsubscribe from this group, send email to sammyjs+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sammyjs?hl=en.
On 3 дек, 08:43, RAFIDINIAINA Francky <rfran...@gmail.com> wrote:
> Hi Eugene,
>
> I would recommend you to rewrite your paths in a RESTfull manner.
> In your case I would identify 3 resources: Page, User, Image.
> Image belongs to a page. So organise your Sammy paths like this
>
> get 'pages' => list
> get 'page/:id' => show
> get 'pages/new' => new
> post 'pages' => create
> get 'page/edit/:id' => edit
> put 'page/:id' => update
> delete 'page/:id' => destroy
>
> get 'users/login' and so on for user resource
>
> get 'page/:page_id/images' => list images of a page
> get 'page/:page_id/image/:id' => shows an image taht belongs to a page
> .. and so on for image resource
>
> I recommend you for your inspirationhttp://guides.rubyonrails.org/routing.html
>
> By doing so, all your routes are defined physically in the same level but
> conceptually, it will satisty you nesting needs.
>
> G'day !
>
> 2011/12/2 Eugene Chernyshov <chernyshov.eug...@gmail.com>
-alex
--
a lex 13 x
http://a13x.net | @a13xnet