Forum: Ruby on Rails Components and layouts

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
nicholas.stuart (Guest)
on 2005-11-17 18:57
(Received via mailing list)
Is there anyway for a component to use the layouts availble to rest of
the app, but still use the templates under its own directory? Setting
the layout with a "layouts/admin" say, just produces "can not find
admin.rhtml...". Is there anyway around this?

If not I guess I could just put the views under app/views, but really
wanted to keep things seperate.

Thanks!
-Nick
Jm M. (Guest)
on 2005-11-17 19:06
(Received via mailing list)
I try to call up images in my browser from my
public/images directory and get a routing error.

   Here is my path

http://localhost:3000/images/logo.jpg

   And the error

Routing Error

Recognition failed for "/images/logo.jpg"

Any ideas why this would be happening?
dmitry (Guest)
on 2005-11-17 22:26
(Received via mailing list)
On Thursday 17 November 2005 23:56, Nick S. wrote:
> Is there anyway for a component to use the layouts availble to rest
> of the app, but still use the templates under its own directory?
> Setting the layout with a "layouts/admin" say, just produces "can
> not find admin.rhtml...". Is there anyway around this?
>
> If not I guess I could just put the views under app/views, but
> really wanted to keep things seperate.
Can symlink be an easy way out?
Btw, I've tried to supply full path to layout method, like
"#{RAILS_ROOT}app/views/layouts/blah.rhtml" but with no success. I
wonder why so..
dmitry (Guest)
on 2005-11-17 22:41
(Received via mailing list)
On Friday 18 November 2005 00:04, jonathan Mcintire wrote:
>
> Recognition failed for "/images/logo.jpg"
>
> Any ideas why this would be happening?
Are you sure logo.jpg is in public/images? And make sure the
permissions are correct.
nicholas.stuart (Guest)
on 2005-11-17 22:56
(Received via mailing list)
Symlinking wont work in this case, its gotta be deployable on a windows
box,
Michael (Guest)
on 2005-11-18 00:10
I had a similar problem and turned out my path to the image was missing
a slash.

Example:

I had:

images/logo.gif

and Rails needed

/images/logo.gif

Not sure if it is the same for you or not, but you can give it a shot.
nicholas.stuart (Guest)
on 2005-11-18 19:01
(Received via mailing list)
Not quite. All the stuff under /public is working fine and as it
should. My problem is that if I have views under
/components/my_component/comp/index.rhtml
It can't access a layout under /app/views/layouts/admin.rhtml

For now I've moved the views of the components under app/views but
this kind of defeats the purpose in my mind.

Any other ideas on this?

-Nick
luben.manolov (Guest)
on 2005-11-18 23:00
(Received via mailing list)
Hi Nick,

On 11/18/05, Nick S. <removed_email_address@domain.invalid> wrote:
>
> Not quite. All the stuff under /public is working fine and as it
> should. My problem is that if I have views under
> /components/my_component/comp/index.rhtml
> It can't access a layout under /app/views/layouts/admin.rhtml
>
> For now I've moved the views of the components under app/views but
> this kind of defeats the purpose in my mind.
>
> Any other ideas on this?


I am using Subversion and I have solved this problem by using
"svn:external"
property to link components/layouts to /app/views/layouts. Not very
beautiful solution but works on Windows.

Best regards,

Luben
nicholas.stuart (Guest)
on 2005-11-20 01:21
(Received via mailing list)
Interesting idea Luben. This might be the route I go, but it looks
like there is no 'offical' way to handle this. Guess I'll have open up
an enhancement request then...

Thanks again!
-Nick
This topic is locked and can not be replied to.