Recommendation to use local_assigns.has_key?

June 04, 2015

Reading time ~1 minute

You can check loal definition using defined? and local_assigns.has_key? local_assigns.has_key? is more simple than defined?. You can write one line.

<% if defined? :user_name %>
 <p>hello <%= user_name  %></p>
<% else %>
 <p>hello world</p>
<% end %>

OR

<p>hello <%= local_assigns.has_key? :user_name ? user_name : "world" %></p>

add ticket number to git commit automatically

Most of ticket tracker like Github, pivotal tracker have function to connect your commit to ticket(story).But every time when you commit ...… Continue reading

I will build frontend and backend separately

Published on September 28, 2016

order of angular controller's initialisation

Published on October 05, 2015