Skip to content

Instantly share code, notes, and snippets.

@hunterae
hunterae / webpacker-setup
Last active August 1, 2019 19:50
Install or add Webpacker
// ------ FOR A NEW RAILS APPLICATION --------
// From command line
rails new webpackerapp --skip-sprockets --webpack
// ------ FOR AN EXISTING RAILS APPLICATION --------
// Or add to Gemfile:
gem 'webpacker'
// From command line
bundle install
bundle exec rails webpacker:install
@hunterae
hunterae / VueSourceCodeBuilderTextNode.vue
Created May 22, 2019 17:56
VueSourceCodeBuilder - TextNode
<text-node text="Text as a prop" />
<text-node text="<div>Raw HTML</div>" />
<text-node curly-braces text="textInCurlyBraces" />
<text-node>
Text within Tag
</text-node>
<text-node>
<text-node text="Nested Text Node" />
</text-node>
<% current_month = @date.month %>
<ul class="month-selector">
<% @budget.months.each_with_index do |d, i| %>
- <li><a class="button<%= " ui-state-focus" if current_month == d.month %>" href="?date=<%= URI.escape(Date.parse("#{d.month}/1/#{d.year}").strftime())%>"><%= d.
+ <li><a class="button<%= " ui-state-focus" if current_month == d.month %>" href="?date=<%= "#{d.year}-#{d.month}-01" %>"><%= d.strftime("%b") %><% if i==0 || d.
<% end %>
</ul>