Created
December 21, 2012 14:07
-
-
Save skyee/4353048 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp::Labels; | |
use Mojo::Base 'Mojolicious::Controller'; | |
use Modal::Labels; | |
#/show (Accept: application/xml) | |
#/show.js (Accept: application/javascript) | |
sub show { | |
my $self = shift; | |
$self->stash(labels => Modal::Labels->select); | |
$self->respond_to( | |
js=> {template => 'show', format => 'js'}, | |
xml => {template => 'show',partial = 1} | |
); | |
} | |
package MyApp::Posts; | |
use Mojo::Base 'Mojolicious::Controller'; | |
sub index { | |
my $self = shift; | |
$self->stash(labels => MyApp::Labels); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment