-
Notifications
You must be signed in to change notification settings - Fork 236
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
Cannot render Rails env variable within cell #407
Comments
Use :: Rails.env.development? 2016-05-26 16:00 GMT+01:00 chrisyeung1121 [email protected]:
|
I tried using |
Sorry, I put a space into that by mistake. It should had been: ::Rails.env.development? |
I tried that as well. It all result in the same error :( On May 26 2016, at 11:37 pm, Sam Stickland <[email protected]>
|
Wait, I didn't read your error message properly before.. Where are you calling all_subclasses from? The ::Rails syntax is definitely correct, I'm using that in my own project. |
I am calling it from spec/cell/. Is it not included in test ?
|
What happens when you call |
If I just run Failures:
1) PromotionRuleCell
Failure/Error: it { expect(cell(:promotion_rule).(:selector).all_subclasses).to eq(4) }
NoMethodError:
undefined method `all_subclasses' for #<ActiveSupport::SafeBuffer:0x007fc63be6f8a8>
# ./spec/cells/promotion_rule_cell_spec.rb:6:in `block (2 levels) in <top (required)>'
Finished in 0.3323 seconds (files took 6.01 seconds to load)
1 example, 1 failure
Failed examples:
rspec ./spec/cells/promotion_rule_cell_spec.rb:6 # PromotionRuleCell This is my spec file if it helps
|
Of course, because this is wrong! 😜
|
I have a following cell class
I basically have to access Rails.env variable but since
Rails
has become a module underCell::Slim::Rails:Module
I can't access Rails.env now. Is there any way to work around this?The text was updated successfully, but these errors were encountered: