[Radiant] writing extensions - custom (non-scaffold) views
Jan Rietema
jan.rietema at web.de
Thu Jan 3 12:04:36 CST 2008
Sean,
Thanks for the quick response, I was somehow expecting views to be
"nested" inside Radiant (for a reason I fail to recall now), but on
second sight app/views/admin/<controller> is actually a straight-forward
and logical path for the views.
Now that the view works without a render hack, I can reference instance
variables in the view without problems.
One thing I noticed is that there isn't a flash[:notice] display when
redirecting to the main admin page. But otherwise, all is well!
Jan
On Thu, 03 Jan 2008 08:33:40 -0600
Sean Cribbs <seancribbs at gmail.com> wrote:
> Jan,
>
> First, if your controller is public-facing (and not an admin tool),
> put this line at the top to disable the login requirement:
>
> no_login_required
>
> Second, your views should correspond to the _controller name_, not
> the extension name, unless of course they happened to be named the
> same thing. So if your controller is Admin::FooController, your view
> path should be app/views/admin/foo.
>
> Third, in most cases, you should be passing objects as instance
> variables to views, not locals, although there should be nothing to
> stop you from explicitly rendering the view with locals.
>
> Sean
More information about the Radiant
mailing list