Permalink
Browse files

Amend commit e687be3 to allow the 'render' action on non-existent pag…

…es (i.e. newly created pages, while the content of their first version is being typed in
  • Loading branch information...
dandv committed Aug 13, 2011
1 parent e51f3cd commit 7966beba59540a315e878bc55c7dc7d8909dcf45
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/MojoMojo/Controller/Root.pm
@@ -113,10 +113,11 @@ sub auto : Private {
my ( $self, $c ) = @_;
# Prevent most actions from running on non-existent pages. This fixes issues #36 and #80.
+ # 'render' should be allowed so that jsrpc/render can be used to preview newly created pages while the first version is being typed in
my $proto_pages = $c->stash->{proto_pages};
$c->detach('MojoMojo::Controller::Page', 'suggest')
- if ($proto_pages && @$proto_pages && $c->action->name !~ /^(edit|login|logout|register|recover_pass)$/);
-
+ if ($proto_pages && @$proto_pages && $c->action->name !~ /^(edit|render|login|logout|register|recover_pass)$/);
+
if ( $c->pref('enforce_login') ) {
# allow a few actions
if ( grep $c->action->name eq $_, qw/login logout recover_pass register/ ) {

0 comments on commit 7966beb

Please sign in to comment.