-
Notifications
You must be signed in to change notification settings - Fork 16
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
Breaks t('.something')
? 😭
#6
Comments
This is a hard one. 😑 |
I've solved this, but tagging @domchristie because my solution to this problem doesn't support unnamed block content anymore... and I'm not sure there is anything I can do about it. Will tidy this up and push up a PR tomorrow. |
Is the non-shorthand version that bad? (e.g. |
@domchristie Yeah, I had the same thought, but I don't like the idea that we'd be breaking something people are used to, and in my own project I noticed that use of the shorthand is keeping the views really, really clean, especially in applications with large domain models with lots of name spacing, etc. |
controversial! 😝 |
I suppose the downside is that it loses the natural progression of going from "layout" partials to Nice Partials, e.g. <%= render 'section' do %>
<p>Lorem ipsum</p>
<% end %> <%= render 'section' do |p| %>
<% p.content_for :heading, 'Hello, World' %>
<p>Lorem ipsum</p>
<% end %> This would require an update to every template to wrap |
Hmm... actually, it's possible my solution to the |
Initial attempt at fixing the `t` helper prefix. Fixes #6.
It looks like the magic of
t('.something')
is broken because theyield
that causes it to execute is in a different view. This is pretty sad, TBH.For example, in
app/views/some_class/_index.html.erb
:Yields:
It should have been:
The text was updated successfully, but these errors were encountered: