•      
  • Garbage Burrito!An online internet web blog by Ben Kittrell
  • Blog
  • Tweets
  • Contact
  • Photos
  • Favorite Burrito
  • Burrito Shop
  • Cart
  • Login
  •      
 View Cart Login        

Garbage Burrito!

An online internet web blog by Ben Kittrell

  • Blog
  • Tweets
  • Contact
  • Photos
  • Favorite Burrito
  • Burrito Shop

 About Ben

Co-Founder of Doodlekit. Coder, Home Renovator, Enjoyer of Refreshing Beverages.

Sometimes I blog here, sometimes on Doodlekit, sometimes I tweet and now I podcast.

Most recently I've been doing software development strategy consulting for Kansas City businesses.  

 Doodlekit

Doodlekit is the easiest way for small businesses to create their own website.  Used by millions in over 180 countries.

Follow us for updates.

Doodlekit on Twitter
AngelList
LinkedIn
Facebook

160x600.gif

free website builder

 

 Blog Entries

  • Great Review of Doodlekit by Comparakeet
  • New Podcast Episode - Danny O'Neill - The Roasterie - Spare Room Radio
  • What I Wish Someone Told Me Before I Started Buying Podcast Equipment
  • Announcing Spare Room Radio - New Podcast
  • Google Fiber Experiment: Cloud Video Transcoding
more  

 Links


  • website reviewer
  • live on - sharing memories
  • kids website builder
  • resume website
  • martial arts website builder
  • affiliate website builder
  • teacher website

 Login

 Forgot Password?

 Forum Posts

  • rajablogid: RE: Stupid Simple, Yet Effective
  • julie mack: RE: JavaScripting with PDF's?
  • Megan Cunningham: RE: Java Generics
  • Deepika Sharma: RE: Grilled Cheese
  • German Byrd: RE: Grilled Cheese
more  

 Custom Login

 Forgot Password?
 Register

 Back to Blog

Putting your layouts in a non "layouts" directory in Rails

Ben Kittrell
 05/04/2012 06:51PM

It's very easy to tell Rails to look for a layout in a different location from default, example...

render :layout => '/path/to/layouts/my_layout'
 

There's one caveat, the word "layouts" must be in the path.  This is probably fine for most cases, but I had a special case.  After digging through the Rails source I finally found a solution.  This method in the AbstractController is what does the check.

def _normalize_layout(value)
  value.is_a?(String) && value !~ /\blayouts/ ? "layouts/#{value}" : value
end

The solution is to simply override that method in your controller.  Here's my case.

 

def _normalize_layout(value)
  value =~ /templates/ ? value : "layouts/#{value}"
end
 
If the path has "templates" in it, then leave it alone.  Otherwise go ahead and prepend "layouts/" for default scenarios.  

 

Tags: rails, ruby, layouts, hacks

 Comments

 Ashley  02/26/2015 06:38AM 

This web site is really a walk-through for all of the info you wanted about this and didn’t know who to ask. Glimpse here, and you’ll definitely discover it….
http://www.masonryhomes.org

 Nancy  03/05/2015 11:40AM 

That would make a sense to them as they are working hard to achieve good result.
http://www.food-play.org

 Amy  03/06/2015 10:44AM 

Must say that overall I am really impressed with this blog. It is easy to see that you are passionate about your writing. If only I had your writing ability I look forward to more updates and will be returning.
http://www.kermitontour.com

 David  03/11/2015 09:56AM 

I've been trying to find out a little more about this kind of stuff, thanks for sharing
http://www.technews404.com

 Amy  04/01/2015 12:47PM 

I agree with you. This post is truly inspiring. I like your post and everything you share with us is current and very informative, I want to bookmark the page so I can return here from you that you have done a fantastic job.
http://www.linden-method.co.uk

 Abbi  05/19/2015 09:36AM 

Always thinking to do the same thing again and again , i am very thankful that i found this one..
http://www.slovakcatercume.com

 siprass  03/15/2016 09:12AM 

thanks for post for android apps visit https://appspcdownloadhere.wordpress.com/
https://appspcdownloadhere.wordpress.com/2015/12/01/how-to-run-android-apps-forpc/
https://appspcdownloadhere.wordpress.com/2015/12/01/best-downloadervidmate-apptubemate-app-for-pc/
https://appspcdownloadhere.wordpress.com/2015/12/01/best-chatting-apps-for-pc/

  03/21/2016 08:56AM 

I was really so much happy to follow the instructions and layouts in a non directory articles. Everything we are using from these http://www.topessayservices.com/order-samples/ blog entry websites. So many people are ready to follow the instructions and essay services.

  03/27/2016 07:08PM 

I'm not an expert but I find www.ukdissertationspro.com site very essential and well made!

 marson  03/30/2016 04:34AM 

Let's face it not all of us accept the money ability to accept a closet abounding.http://www.choosebags.co.uk

 Giovanni  05/05/2016 01:29PM 

About your "layouts" directory in Rails" Post just i say its really great and full of informative post. I really like it and i want to say thanks and please update some more great post. Click our website http://playgroundtilesuk.co.uk/ & Get Playground tiles in affordable price.

  05/05/2016 01:29PM 

That's really very awesome post. It's extremely helpful for me. I gain a lot information from it. It is really very wonderful blog. Get gym flooring buy in best rates from http://gymmatsuk.co.uk/gym-flooring.html

  05/19/2016 03:33PM 

I feel about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me. Get custom stickers roll cheap from http://www.stickersprinting.uk/Custom-Stickers

  05/30/2016 10:37PM 

It is the great post of putting layout in this website. I know this post give me something useful information. Kindly share some more putting your layouts in a non "layouts" directory in Rails infotainment.

http://www.poloshirts.com.pk/
http://www.poloshirts.com.pk/polo-t-shirts/
http://www.poloshirts.com.pk/mens-polo-shirts/
http://www.poloshirts.com.pk/xxxl-polo-shirts/
http://www.poloshirts.com.pk/girls-polo-shirts/
http://www.poloshirts.com.pk/polo-ralph-lauren/
http://www.poloshirts.com.pk/ralph-lauren-polo-shirts/
http://www.poloshirts.com.pk/men-polo-ralph-lauren/
http://www.poloshirts.com.pk/pink-polo-shirts/
http://www.poloshirts.com.pk/black-white-polo-t-shirts/
http://www.poloshirts.com.pk/coloured-polo-shirts/

 Frederick  06/04/2016 10:55PM 

This article is such a nice and interesting one, I'm very satisfied with the provided contents. I hope more excellent articles would be posted in your website. Thank you so much for this and keep sharing. It's really nice and meaningful. It's really cool blog. Linking is very useful thing. you have really helped lots of people who visit this blog and provide them useful information.

http://replicapak.blogspot.com/
http://replicapak.blogspot.com/2016/06/m-lawn-collection.html
http://replicapak.blogspot.com/2016/06/z-s-j.html
http://replicapak.blogspot.com/2016/06/zarashahjahan.html
http://replicapak.blogspot.com/2016/05/zara-shah-jahan-master-replica.html
http://replicapak.blogspot.com/
http://replicapak.blogspot.com/

  06/29/2016 07:08PM 

upercar HOT CARS & HOT GIRLS Supercars Custom Tuning And More Auto Show Super Car. International Motor Show More Hot Cars & Hot Girls The world's largest custom car show videos from my channel.
https://www.youtube.com/watch?v=wpsSwdy-Yik
https://www.youtube.com/watch?v=ajZV6m22wUE
https://www.youtube.com/watch?v=z_UrDSwDykk
https://www.youtube.com/watch?v=6wW3pdA_ISs
https://www.youtube.com/watch?v=3SMLJY19dkg
https://www.youtube.com/watch?v=u9Jn5qlSMZM

 Steve Locke My Website  06/29/2016 08:57PM 

Very useful, thanks.

 bragas calvin klein baratas My Website  07/21/2016 06:13AM 

Different parts of the computers on reasonable prices. You can get bragas calvin klein the high deals of the computer parts with good quality made. These are made by the different high quality parts made companies. You can get them online.

 gmain  09/03/2016 08:35PM 

Every one of the applications and entertainments here are for home or individual use in a manner of speaking. In case any apk download infringes your copyright, please contact us. iTube Music Player is the property and trademark from the specialist iTube Music Player http://itubedownloaderapp.com/
Download and save the apk(https://mysp.ac/3b5Yx) record to your Android Phone's SD card and present it physically onto the Android contraption.http://itubedownloaderapp.com/itube-ios-iphone-free/
In case there is any issue please let us know. Make your issue in comment box underneath.

 www.aussieessay.org My Website  12/05/2016 08:34PM 

That boy is very good at hula hooping. I've never seen such talented performance of hula hooping at his age of boys or girls. Really admiring job!! Thanks for letting know.
http://www.aussieessay.org/

 Chris77  12/13/2016 08:24PM 

Check out if the msvcr100.dll is inside the Bin and recover it. The simplest reason for a "missing" msvcr100.dll data file is the fact that you may have mistakenly deleted it and it's gone in the Bin. Generally if the DLL data file is not in the suitable folder, then applications that depend upon it can't utilize it, and so the errors is displayed.

Source http://www.msvcr100dll.com/

 Buy Backlinks for SEO  12/17/2016 07:39AM 

The amazing thing about them is that they don’t build links in a single day as they schedule links building for seven days to obtain maximum results. They will give you report about you backlinks in an hour.<a href="https://buybacklinks.wiki/">Buy Backlinks for SEO</a>

 IN locksmith  12/20/2016 09:09AM 

You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant http://amigoslocksmithindianapolis.com

 deli Drive thru white plains ny My Website  12/28/2016 09:37AM 

Your blog provided us with valuable information to work with. Each & every tips of your post are awesome http://www.eatnestos.com

 gon  01/12/2017 11:18PM 

http://bestandroidappshop.com/best-free-music-download-apps/
http://bestandroidappshop.com/best-xposed-modules-for-android-phone-2017/
http://bestandroidappshop.com/download-windows-7-launcher-for-android-free/
http://bestandroidappshop.com/best-android-launcher/

 lucky patcher apk My Website  01/25/2017 06:48AM 

thanx for the share!!!

 Obat Kanker Hati Primer My Website  03/08/2017 08:53AM 

http://www.ahlinyaterapikanker.com/obat-kanker-hati-primer/ | http://umarblogkesehatan.blogspot.com/2017/03/obat-paru-paru-bocor-terbukti-mujarab.html | http://umarblogherbal.com/tips-sehat-untuk-gangguan-limpa/ I offer the herbal medicine to overcome the disease complaints

 stevecook  03/15/2017 12:38PM 

thanks for this
http://www.lucky-patcher.co/kingroot-app-apk/

 kamal nath  03/23/2017 07:47AM 

http://tnboardresult2017.weebly.com/

 results.itschool.gov.in My Website  03/31/2017 12:27PM 

http://keralaresultsnic-in.in/results-itschool-gov-in-2017-sslc-results/

 stuartsmith  04/04/2017 11:50AM 

great post thanks so much for posting this post over here http://uspstrackingnumbers.com/

 Galaxy Note 8 Release Date My Website  04/19/2017 03:37PM 

After the fiasco of the Galaxy Note 7 battery, Samsung is all set to regain the reputation of the coveted tablet series with the upcoming Galaxy Note 8. The much-anticipated device is expected to make its debut a couple of months later. So want to know more about the Samsung Galaxy Note 8? Check out this website https://galaxynote8z.com/

 badree27 My Website  04/23/2017 06:02PM 

It's a good piece of information. High intensity content and it is presented in a good manner

https://awalmartone.com/walmartone-associate-login-www-walmartone-com/

 Apple iPad Mini 5 Features My Website  04/24/2017 11:12AM 

The Apple iPad Mini 5 is perhaps one of the most awaited phablets in 2-017 with the upcoming device slated to incorporate almost all major technical advancements by Apple today. The device, which is expected to feature at the MWC 2017 event in February also stands out from the rest owing its proposed new moniker, which might have it called the iPad Mini Pro ditching the Mini 5 moniker.

 personal statement service  04/24/2017 04:34PM 

I want you to thank for your time of this wonderful read!!! I definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! https://www.kingessay.co.uk/personal-statement/

 biharboard.ac.in My Website  05/02/2017 08:37AM 

Bihar School Examination Board, Patna has held Bihar Board 10th Class 2017 Examinations in the Month of March biharboard.ac.in
http://biharboardac-in.in/

 fredrick  05/12/2017 09:35AM 

Great work! I really impressed to read the great information that you have shared best quality stuff in the content of the post. flhomerepair.com/electrical/electrician-jacksonville-fl/ is providing best services.

 james  05/27/2017 07:36AM 

It is my visit to your post, read it thoroughly and want to say that you have shared your experience with very common and simple way. http://callnewyorkplumber.com/ is the best plumbing services provider.

 Dylan  07/11/2017 11:42AM 

Awesome post. Very useful and informative!
bullet force games http://bulletforcegame.com/

 hilary My Website  07/14/2017 01:50PM 

https://www.tinderforpcapp.com/
https://www.tinderforpcapp.com/tinder-apk-for-android-free-download/
https://www.tinderforpcapp.com/tinder-for-mac-pc-free-download/

 Flence Druke My Website  07/21/2017 02:28PM 

Do you want to know more about YouTV Player apk? Visit here for more info.

 Breaking News My Website  07/24/2017 12:09PM 

HII, I Love this amazing iformative website this is good idea, i love you idea.

 Walmart Credit Card login My Website  07/25/2017 10:39AM 

Walmart Credit Card login Walmart is the biggest store in the United States and has hundreds of branches across the globe. Walmart store offers its customers very friendly, flexible purchase

http://www.goo.gl/zFQL41

 Jack  07/28/2017 11:20AM 

What a brilliant job you have done by creating much valuable task. Keep sharing valuable stuff in future.
http://callcaliforniaplumber.com/san-diego-plumbers/

 Technostop My Website  08/09/2017 06:29PM 

Thank you for sharing this post.

 promo gratis qnc jelly gamat  08/10/2017 05:56AM 

may be useful for all, helpful article once and pardon me permission to share also here

 Moviepops My Website  08/30/2017 05:27PM 

Good job and bunch of thanks for this valuable post.

 Simon Holister  09/10/2017 11:18AM 

Okay, so how should be our site layout? There is a blog that write above best car wash soap http://bestcarwashsoapguide.com/ . creating the layout like this way difficult?

 new year images My Website  09/12/2017 01:10PM 

http://www.happynewyearimages-2016.com/2017/06/funny-christmas-whatsapp-status-images.html
http://www.happynewyearimages-2016.com/2017/06/download-free-merry-christmas-facebook-cover-photo.html
http://www.happynewyearimages-2016.com/2017/06/best-christmas-songs-for-kids.html

 Mrstewart  09/14/2017 12:29PM 

Hi, yes. I think you should follow this layout

http://musicdownloaderfree.org/4shared-music-downloader-free/

 Previous 1 2 3 Next 

 Search

Follow On...

  • Facebook
  • Twitter
  • LinkedIn
  • Google+
  • Pinterest
  • RSS Feeds
  • Blog Posts,
  • Gallery Images,
  • Forum Topics

Copyright © 2006 Garbage Burrito. All Rights Reserved.
hosted by doodlekit™- free website builder

 

 powered by Doodlekit™ Free Website Builder