Hi!
I have a model like this:
class Test1
attr_accessor :counter
def initialize
@countter = 0
end
def increase
@countter += 1
end
end
A helper
module DiscsHelper
def hidden_div_if(condition, attributes = {})
if condition
attributes[“style” ] = “display: none”
end
attrs = tag_options(attributes.stringify_keys)
“<div #{attrs}>”
end
end
A view:
<% hidden_div_if(@test.counter > 0, :id => "test") %>
<%= render(:partial => "test", :object => @test) %>
The problem is that when y try to test it the HTML result is wrong,
it’ not create the header of the dev test, what am i doing wrong?
test
Salu2…