New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better way to handle shared layouts #767

Closed
nesquena opened this Issue Jan 24, 2012 · 7 comments

Comments

Projects
None yet
4 participants
@nesquena
Member

nesquena commented Jan 24, 2012

Sharing layouts between apps. that's something that needs to be addressed. there needs to be a more intuitive way to do that.

i figures something like how we deal with routes could work. e.g Processes::App.url(:instances, :index)

render 'index', :layout => Main::App.layouts(:application)

(reported by @achiu)

@dcu

This comment has been minimized.

Show comment
Hide comment
@dcu

dcu Mar 4, 2012

Contributor

I would prefer something like MyApp.view_path("users/show") or MyApp.view_path("layouts/application")

internally MyApp.layouts() could be a call to MyApp.view_path("layouts/*")

what do you guys think?

Contributor

dcu commented Mar 4, 2012

I would prefer something like MyApp.view_path("users/show") or MyApp.view_path("layouts/application")

internally MyApp.layouts() could be a call to MyApp.view_path("layouts/*")

what do you guys think?

@snowyu

This comment has been minimized.

Show comment
Hide comment
@snowyu

snowyu Mar 5, 2012

@nesquena +1 : agree u. and It should have a global switcher too. eg,

set :layout,  Main::App.layouts(:application)

snowyu commented Mar 5, 2012

@nesquena +1 : agree u. and It should have a global switcher too. eg,

set :layout,  Main::App.layouts(:application)
@dcu

This comment has been minimized.

Show comment
Hide comment
@dcu

dcu Mar 15, 2012

Contributor

you said there's a way to share layouts, what is it?

Contributor

dcu commented Mar 15, 2012

you said there's a way to share layouts, what is it?

@snowyu

This comment has been minimized.

Show comment
Hide comment
@snowyu

snowyu Mar 15, 2012

check my folk: snowyu/padrino-framework@ec12674

but the stylesheets and js is not processed. so u must use the absoluted path.

snowyu commented Mar 15, 2012

check my folk: snowyu/padrino-framework@ec12674

but the stylesheets and js is not processed. so u must use the absoluted path.

@dcu

This comment has been minimized.

Show comment
Hide comment
@dcu

dcu Mar 15, 2012

Contributor

thanks @snowyu after looking at your code I realized I could do

layout :"../../myapp/views/layout/application"

the bad thing is that it doesnt look up partials in the same app.

Contributor

dcu commented Mar 15, 2012

thanks @snowyu after looking at your code I realized I could do

layout :"../../myapp/views/layout/application"

the bad thing is that it doesnt look up partials in the same app.

@snowyu

This comment has been minimized.

Show comment
Hide comment
@snowyu

snowyu Mar 16, 2012

En, That's why I hacked the code: first use the app layout if exists, else use the parent's.

Another things: if u wanna partial sth. in the parent layout, u should specify the views path:

partial('layouts/header', :views => MyApp.views)

snowyu commented Mar 16, 2012

En, That's why I hacked the code: first use the app layout if exists, else use the parent's.

Another things: if u wanna partial sth. in the parent layout, u should specify the views path:

partial('layouts/header', :views => MyApp.views)
@activestylus

This comment has been minimized.

Show comment
Hide comment
@activestylus

activestylus Apr 28, 2012

Contributor

+1 - @snowyu, thanks for the hack!

@nesquena - I see you tagged this for 1.0 release. Padrino certainly feels pretty solid right now. Curious how close we are to that milestone.

Contributor

activestylus commented Apr 28, 2012

+1 - @snowyu, thanks for the hack!

@nesquena - I see you tagged this for 1.0 release. Padrino certainly feels pretty solid right now. Curious how close we are to that milestone.

@ujifgc ujifgc closed this in 41cdc59 Nov 7, 2013

Ortuna added a commit to Ortuna/padrino-framework that referenced this issue Jan 17, 2014

parisholley added a commit to parisholley/padrino-framework that referenced this issue Mar 6, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment