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

idea for ya #167

Closed
wavded opened this issue Mar 10, 2011 · 7 comments
Closed

idea for ya #167

wavded opened this issue Mar 10, 2011 · 7 comments

Comments

@wavded
Copy link
Contributor

wavded commented Mar 10, 2011

maybe this implemented but I haven't found it yet, could there be a way to output the value of a variable and have it swallowed up if its null, undefined, NaN and just output nothing instead of those values?

@tj
Copy link
Contributor

tj commented Mar 10, 2011

I did this for == null so null and undefined should be ok, ex: textarea= user.signature when undefined wont output "undefined" anymore

@wavded
Copy link
Contributor Author

wavded commented Mar 11, 2011

yeah that works, i mean #{these} statements

@tj
Copy link
Contributor

tj commented Mar 11, 2011

ah! yeah I may have missed interpolation, I'll check

@tj
Copy link
Contributor

tj commented Mar 11, 2011

actually im not sure these should be blank, for example you end up with the awkward gaps "

Just a test

Just a test

Just a 0 test

" (might not show well here) , whereas foo= undefined should be blank im not sure hello #{name} should be, you pretty much always want something there

@wavded
Copy link
Contributor Author

wavded commented Mar 11, 2011

but what if you are outputting a list of things from a database

ul
  li Name:    #{user.accountInfo.firstName + user.accountInfo.lastName}
  li Title:   #{user.accountInfo.title}
  li Company: #{user.accountInfo.company}
  li Address: #{user.accountInfo.address}
  li City:    #{user.accountInfo.city}
  li State:   #{user.accountInfo.state}
  li Zip:     #{user.accountInfo.zip}
  li Phone:   #{user.accountInfo.phone}
  li Fax:     #{user.accountInfo.fax}
  li Email:   #{user.accountInfo.email}

maybe a === against null or undefined?

@tj
Copy link
Contributor

tj commented Mar 11, 2011

== null will work for those two

yeah that is true

@wavded
Copy link
Contributor Author

wavded commented Mar 11, 2011

another thought is that the interpolations differ depending on = or #{} are different which may be confusing (were for me)

This issue was closed.
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