Ruby Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesRuby Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old October 24th, 2007, 05:01 PM
peteh peteh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 42 peteh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 22 m 20 sec
Reputation Power: 5
Rails view search path

I'd like to somehow change the view serach path in Rails such that when a view like say _show.rhtml is requested it first looks in path x, then y and finally z.

This mechanism would allow me to more properly subclass controllers in that I can also inherit or override the views associated with the super controller.

Reply With Quote
  #2  
Old October 29th, 2007, 02:49 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,440 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 50 m 56 sec
Reputation Power: 797
Look into editing the config/routes.rb file.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
  #3  
Old October 29th, 2007, 03:06 PM
peteh peteh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 42 peteh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 22 m 20 sec
Reputation Power: 5
Quote:
Originally Posted by Scorpions4ever
Look into editing the config/routes.rb file.


It seems you don't understand the problem. The routes.rb file is of no use to accomplish this.

Consider controller B which inherits from controller A. Both controllers implement a method “show”. A::show renders the template show.rhtml which in turn renders embedded templates show_part1.rhtml and show_part2.rhtml.

Ideally, I should now be able to implement my own versions of any or none of these view templates in controller B. The idea is that any view implemented for B will override the view implemented for A.

In a nutshell, what I really want is to change the Rails view lookup path. Controller B would simply append Controller A’s view path to the Rails view lookup path.

Reply With Quote
  #4  
Old November 1st, 2007, 05:42 PM
peteh peteh is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 42 peteh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 22 m 20 sec
Reputation Power: 5

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesRuby Programming > Rails view search path


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway