Skip to content
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

partials ? #7

Closed
smeevil opened this issue Sep 21, 2015 · 10 comments
Closed

partials ? #7

smeevil opened this issue Sep 21, 2015 · 10 comments

Comments

@smeevil
Copy link

smeevil commented Sep 21, 2015

Hi,

I was wondering if there is already support for rendering partials ?

/Gerard

@doomspork
Copy link
Member

Hi @smeevil, it should be supported. PhoenixSlim (and SlimFast) translate Slim to EEx and rely on EEx to handle the bulk of the work, rendering partial should work so long as the appropriate EEx is generated.

Are you having problems? If so you might have encountered a bug.

@smeevil
Copy link
Author

smeevil commented Sep 22, 2015

As soon as i try to
= render "_nav.html"
it returns
** (CompileError) web/views/layout_view.ex:1: imported Phoenix.Controller.render/1 conflicts with local function

@doomspork
Copy link
Member

Hi @smeevil do you have a sample project I could look at? I'm wondering if something is being included that doesn't need to be, PhoenixSlim is no different from Chris McCord's PhoenixHaml.

In addition to the config/config.exs updates for PhoenixSlim, are you also including using SlimFast?

@smeevil
Copy link
Author

smeevil commented Sep 23, 2015

The error only seems to pop up when using the render in a layout (templates/layout/app.html.slim)
If I use it in a "normal" template, it does work O.o
Can you confirm this as well ?

@doomspork
Copy link
Member

@smeevil that's interesting and not something I have experienced.

I'm hoping to set some time aside this week to put together a sample Phoenix + PhoenixSlim project which I hope allow me to repo this issue. I'll ping you on the repo so you can give me feedback on setting up your scenario.

@doomspork
Copy link
Member

Hi @smeevil, sorry for the delay I've been very busy.

I have put together a sample project at doomspork/phoenix_slim_example, can you take a look at it? I tried to reproduce your issue in the layout here but everything appears to be working.

@doomspork
Copy link
Member

@smeevil have you had an opportunity to check out the sample project?

What version of Elixir and Phoenix are you using btw?

@doomspork
Copy link
Member

I'm closing this for now because it appears to not be an issue. @smeevil please let me know otherwise!

Thanks

@smeevil
Copy link
Author

smeevil commented Nov 6, 2015

Hi man,

Sorry for the horrible late update, but actually working on several phoenix projects now and got a bit busy.

I did not encounter the error in any of the other projects, so i finally got some time to return to this one and found the problem :)

In the layout view I accidentally had both :
use MyApp.Web, :view
and
use MyApp.Web, :controller

This was the cause of the problem, removing the controller fixed it.
So in the end, as usual, my bad :)

Nothing to see here, Carry on now !

@doomspork
Copy link
Member

Thanks for the follow-up @smeevil, glad things are working! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants