- or download this
package MusicApp::Controller::Album;
use Moose;
...
$c->response->redirect($c->uri_for($self->action_for('list')));
}
1;
- or download this
# First, create the Models
...
__PACKAGE__->has_many(album_songs => 'MusicApp::Schema::Result::AlbumS
+ong', 'album_id');
__PACKAGE__->many_to_many(songs => 'album_songs', 'song');
1;
- or download this
package MusicApp::Schema::Result::Song;
...
__PACKAGE__->has_many(album_songs => 'MusicApp::Schema::Result::AlbumS
+ong', 'song_id');
__PACKAGE__->many_to_many(albums => 'album_songs', 'album');
1;
- or download this
package MusicApp::Schema::Result::AlbumSong;
use strict;
...
__PACKAGE__->belongs_to(album => 'MusicApp::Schema::Result::Album', 'a
+lbum_id');
__PACKAGE__->belongs_to(song => 'MusicApp::Schema::Result::Song', 'son
+g_id');
1; # Return true value at end of modules
- or download this
package MusicApp::Model::DB;
...
license: http://dev.perl.org/licenses/
version: '0.01'
- or download this
$c->stash(albums => [$c->stash->{resultset}->all]);