Linux SoftwareProgrammingLibrariesCatalyst::Manual::Tutorial::BasicCRUD 0.02

Catalyst::Manual::Tutorial::BasicCRUD 0.02


Catalyst::Manual::Tutorial::BasicCRUD is a Catalyst Tutorial - Part 3: Basic CRUD. Include a Create Action in the Books Controller
Developer:   Kennedy Clark
      more software by author →
Price:  0.00
License:   Perl Artistic License
File size:   126K
Language:   
OS:   
Rating:   0 /5 (0 votes)
Your vote:  
enlarge screenshot


Catalyst::Manual::Tutorial::BasicCRUD is a Catalyst Tutorial - Part 3: Basic CRUD.

Include a Create Action in the Books Controller

Edit lib/MyApp/Controller/Books.pm and enter the following method:

=head2 url_create

Create a book with the supplied title, rating, and author

=cut

sub url_create : Local {
# In addition to self & context, get the title, rating, &
# author_id args from the URL. Note that Catalyst automatically
# puts extra information after the "//model('MyAppDB::Book')->create({
title => $title,
rating => $rating
});

# Add a record to the join table for this book, mapping to
# appropriate author
$book->add_to_book_authors({author_id => $author_id});
# Note: Above is a shortcut for this:
# $book->create_related('book_authors', {author_id => $author_id});

# Assign the Book object to the stash for display in the view
$c->stash->{book} = $book;

# This is a hack to disable XSUB processing in Data::Dumper
# (it's used in the view). This is a work-around for a bug in
# the interaction of some versions or Perl, Data::Dumper & DBIC.
# You won't need this if you aren't using Data::Dumper (or if
# you are running DBIC 0.06001 or greater), but adding it doesn't
# hurt anything either.
$Data::Dumper::Useperl = 1;

# Set the TT template to use
$c->stash->{template} = 'books/create_done.tt2';
}

Notice that Catalyst takes "extra slash-separated information" from the URL and passes it as arguments in @_. The url_create action then uses a simple call to the DBIC create method to add the requested information to the database (with a separate call to add_to_book_authors to update the join table). As do virtually all controller methods (at least the ones that directly handle user input), it then sets the template that should handle this request.

Requirements:
  • Perl
    tags data dumper  book authors  the url  title rating  url create  authors {author  the view  this book  author id}  the join  that catalyst  from the  book create  

    Download Catalyst::Manual::Tutorial::BasicCRUD 0.02


     http://mirrors.evolva.ro/CPAN/authors/id/J/JR/JROCKWAY/Task-Catalyst-Tutorial-0.02.tar.gz


    Authors software

    Catalyst::Manual::Tutorial::BasicCRUD 0.02 (by Kennedy Clark)
    Catalyst::Manual::Tutorial::BasicCRUD is a Catalyst Tutorial - Part 3: Basic CRUD.

    Include a Create Action in the Books Controller

    Catalyst::Manual::Tutorial::AdvancedCRUD 0.02 (by Kennedy Clark)
    Catalyst::Manual::Tutorial::AdvancedCRUD is a Catalyst Tutorial - Part 8: Advanced CRUD.

    Add a Form Creation Helper Method

    Open


    Similar software

    Catalyst::Manual::Tutorial::BasicCRUD 0.02 (by Kennedy Clark)
    Catalyst::Manual::Tutorial::BasicCRUD is a Catalyst Tutorial - Part 3: Basic CRUD.

    Include a Create Action in the Books Controller

    Catalyst::Manual::Tutorial::AdvancedCRUD 0.02 (by Kennedy Clark)
    Catalyst::Manual::Tutorial::AdvancedCRUD is a Catalyst Tutorial - Part 8: Advanced CRUD.

    Add a Form Creation Helper Method

    Open

    Catalyst::Enzyme 0.11 (by Johan Lindstrom)
    Catalyst::Enzyme is a CRUD framework for Catalyst.

    SYNOPSIS

    #Create app
    catalyst BookShelf
    cd BookShelf

    #C

    Handy Address Book CGI 1.3 (by Beiley Software)
    Handy Address Book is software for shareable address books

    Catalyst::Manual::Intro 5.7003 (by Catalyst::Manual::Intro Team)
    Catalyst::Manual::Intro is an Introduction to Catalyst.

    This is a brief introduction to Catalyst

    AJAX Book Reader 1.00 (by Michael Thompson)
    AJAX Book Reader is a complete AJAX client-server application that may be used with a Web browser to display a sequence of text files

    Kallimachos 1.1 (by Phoebus987)
    Kallimachos project is a simple Web-based digital book-catalog intended for personal use

    Alexandria 0.6.1 (by Laurent Sansonetti)
    Alexandria is a GNOME application to help you manage your book collection.

    It is free software, covered by the GNU General Public Li

    Class::DBI::Template::Stash 0.03 (by Jason Kohles)
    Class::DBI::Template::Stash is a Perl module with Template::Stash subclass for Class::DBI::Template.

    SYNOPSIS

    package Music::

    Catalyst::Manual::Cookbook 5.7001 (by Catalyst::Manual::Cookbook Team)


    Other software in this category

    zlib 1.2.3 (by Jean-loup Gailly)
    zlib is designed to be a free, general-purpose, legally unencumbered, lossless data-compression library for use on virtually any comp

    libjpeg v6b (by Independent JPEG Group)
    libjpeg is a library for handling the JPEG (JFIF) image format

    OpenSSL 0.9.7c (by The OpenSSL Project Team)
    The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implement

    libxml2 2.6.27 (by DV)
    Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), libxml2 library i

    GNU C library 2.4 (by Andreas Jaeger)
    GNU C library (glibc) is one of the most important components of GNU Hurd and most modern Linux distributions.

    GNU C library is us

  •     search


    Featured Software

    jEdit 4.3 pre8
    jEdit is an Open Source text editor written in Java

    Opera 9.02
    Surf the Internet in a safer, faster, and easier way with Opera browser

    GNU Aspell 0.60.4
    GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell


    Subscribe in Rojo
    Google Reader
    Add to My Yahoo!

    Add to My AOL
    Subscribe with Bloglines
    Subscribe in NewsGator Online
    Add 'nixbit linux software' to Newsburst from CNET News.com
    del.icio.us nixbit linux software


    Top tags