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.
Comments
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
That would make a sense to them as they are working hard to achieve good result.
http://www.food-play.org
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
I've been trying to find out a little more about this kind of stuff, thanks for sharing
http://www.technews404.com
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
Always thinking to do the same thing again and again , i am very thankful that i found this one..
http://www.slovakcatercume.com
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/
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.
I'm not an expert but I find www.ukdissertationspro.com site very essential and well made!
Let's face it not all of us accept the money ability to accept a closet abounding.http://www.choosebags.co.uk
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.
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
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
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/
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/
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
Very useful, thanks.
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.
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.
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/
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/
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>
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
Your blog provided us with valuable information to work with. Each & every tips of your post are awesome http://www.eatnestos.com
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/
thanx for the share!!!
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
thanks for this
http://www.lucky-patcher.co/kingroot-app-apk/
http://tnboardresult2017.weebly.com/
http://keralaresultsnic-in.in/results-itschool-gov-in-2017-sslc-results/
great post thanks so much for posting this post over here http://uspstrackingnumbers.com/
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/
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/
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.
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/
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/
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.
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.
Awesome post. Very useful and informative!
bullet force games http://bulletforcegame.com/
https://www.tinderforpcapp.com/
https://www.tinderforpcapp.com/tinder-apk-for-android-free-download/
https://www.tinderforpcapp.com/tinder-for-mac-pc-free-download/
Do you want to know more about YouTV Player apk? Visit here for more info.
HII, I Love this amazing iformative website this is good idea, i love you idea.
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
What a brilliant job you have done by creating much valuable task. Keep sharing valuable stuff in future.
http://callcaliforniaplumber.com/san-diego-plumbers/
Thank you for sharing this post.
may be useful for all, helpful article once and pardon me permission to share also here
Good job and bunch of thanks for this valuable post.
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?
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
Hi, yes. I think you should follow this layout
http://musicdownloaderfree.org/4shared-music-downloader-free/