Hello,
Why is this not working
<%= text_field_tag :post_header, ‘’, :name => ‘post[header]’, :value
@post.header if @post.header %>
I want the default value to be @post.header if it’s not nil
Thanks
Hello,
Why is this not working
<%= text_field_tag :post_header, ‘’, :name => ‘post[header]’, :value
@post.header if @post.header %>
I want the default value to be @post.header if it’s not nil
Thanks
You can’t have an if statement embedded in a method like this. Not to
mention you are missing the => operator. Try this:
<%= text_field_tag :post_header, ‘’, :name => ‘post[header]’, :value
=> @post.header ? @post.header : ‘’ %>
On May 5, 8:37 am, Jamal S. [email protected]
dasil003 wrote:
You can’t have an if statement embedded in a method like this. Not to
mention you are missing the => operator. Try this:<%= text_field_tag :post_header, ‘’, :name => ‘post[header]’, :value
=> @post.header ? @post.header : ‘’ %>On May 5, 8:37 am, Jamal S. [email protected]
Thanks,
It rocks
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs