Read more

Default views in Rails 3.0 with custom resolvers

Lexy
April 04, 2011Software engineer at makandra GmbH

It is common in Rails 3.0 applications that you want to provide default views for a group of controllers. Let’s say you have a bunch of controllers inside the Admin namespace and you would like each action to fallback to a default template. So if you are rendering the index action for Admin::PostsController and “app/views/admin/posts/index.html.*” is not available, it should then render “app/views/admin/defaults/index.html”.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Since Rails 3.0, we have a new abstraction called resolvers that holds the logic to find a template.

Posted by Lexy to makandra dev (2011-04-04 21:53)