create one controller handling two view templates

15 views
Skip to first unread message

pinky

unread,
Oct 31, 2013, 2:02:06 PM10/31/13
to spi...@googlegroups.com
Hello,

I was wondering how to create a controller that could handle both create and update template.
EG: I have a 2 controllers called "groups.coffee"& "groupedit.coffee "and two templates: create.mu and edit.mu..I had groups.coffe manage the create.mu template and groupedit.coffee  manage the edit template...however I wanted to combine the groups and groupedit controller as they more or less perform the same function..I need just one controller "groups.coffee" to manage both the tempaltes...

here are the routes for the same:

'/groupedit/:id': (params) ->
                @active().groupedit.active(params)  // this goes to the edit template

'/groups/': (params) ->
                @active(). groups.active(params) // this goes to the create tempalte..

I need just "groups" to have both templates in it.... can anyone suggest me with the routes i should go about doing this???

thanks in advance...



Reply all
Reply to author
Forward
0 new messages