Skip to content

Instantly share code, notes, and snippets.

@telagraphic
Created September 15, 2012 21:35
Show Gist options
  • Save telagraphic/3729893 to your computer and use it in GitHub Desktop.
Save telagraphic/3729893 to your computer and use it in GitHub Desktop.
accessing datetime values...
<h1>Sleep Tracking</h1>
<%= link_to "New Day", new_sleep_path %>
<% @sleep.each do |s| %>
<p>Woke at : <%= s.wake %></p>
<% end %>
Parameters: {"utf8"=>"✓", "authenticity_token"=>"Rik+HnG2VscboM7lo8tiAe9R1JtfMMptclqRYDu6nhc=", "sleep"=>{"wake(1i)"=>"2012", "wake(2i)"=>"9", "wake(3i)"=>"15", "wake(4i)"=>"07", "wake(5i)"=>"15", "sleep(1i)"=>"2012", "sleep(2i)"=>"9", "sleep(3i)"=>"15", "sleep(4i)"=>"21", "sleep(5i)"=>"31"}, "commit"=>"Create Sleep"}
def index
@sleep = Sleep.all
@year = @sleep.params[:sleep]["wake(1i)"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment