Skip to content

Instantly share code, notes, and snippets.

View rubytastic's full-sized avatar

rubytastic rubytastic

View GitHub Profile
!!! Frameset
%html{:xmlns => "http://www.w3.org/1999/xhtml"}
%head
%title
="Books > " + yield(:title) || ""
= render :partial => 'shared/head'
%body{:class => set_body_class()}
- @profile = profile.where(:user_id =>1).first
- if @profile.profile == 0
Profile amount is zero
- if @profile.profile < 0
Profile amount is bigger than zero
- if @profile.profile.to_i == -1
Profile amount is -1
- if @profile.amount == 0
...
- if @profile.amount > 0
...
class Mailer < Devise::Mailer
include Devise::Mailers::Helpers
layout "emailxxxshouldfail"
def welcome_instructions(user)
@user = user
mail(:to => user.email, :subject => "Welcome")
end
Started POST "/users/password" for 127.0.0.1 at 2013-01-19 01:29:21 +0100
Processing by PasswordsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"mMP5xFAXqJtkZm3ezM0kDFp9BkxTAcjtIKpGT3AcCHg=", "user"=>{"email"=>"[email protected]"}, "commit"=>"Request »"}
Rendered /Users/pascal/.rvm/gems/ruby-1.9.3-p194/gems/devise-2.2.2/app/views/devise/mailer/reset_password_instructions.html.erb within layouts/email (0.5ms)
Redirected to http://books.dev:3000/users/password/new
Completed 302 Found in 612ms (ActiveRecord: 0.0ms)
=> ["08:00PM", "08:10PM", "08:20PM", "08:30PM", "08:40PM", "08:50PM", "09:00PM", "09:10PM", "09:20PM", "09:30PM", "09:40PM", "09:50PM", "10:00PM", "10:10PM", "10:20PM", "10:30PM", "10:40PM", "10:50PM", "11:00PM", "11:10PM", "11:20PM", "11:30PM", "11:40PM", "11:50PM"]
Time.parse('20:00').to_datetime.step(Time.parse('23:59'), 10.minutes).to_a.delete_if {|date| date < DateTime.now.to_time}.map {|date| date.strftime("%I:%M%p")}
Time.parse('20:00').to_datetime.step(Time.parse('23:59'), 10.minutes).to_a.map {|date| date.strftime("%I:%M%p")}
=> ["08:00PM", "08:10PM", "08:20PM", "08:30PM", "08:40PM", "08:50PM", "09:00PM", "09:10PM", "09:20PM", "09:30PM", "09:40PM", "09:50PM", "10:00PM", "10:10PM", "10:20PM", "10:30PM", "10:40PM", "10:50PM", "11:00PM", "11:10PM", "11:20PM", "11:30PM", "11:40PM", "11:50PM"]
SystemStackError (stack level too deep):
actionpack (3.2.11) lib/action_dispatch/middleware/reloader.rb:70
if params[:code].present?
# increase beta.shared where code = params[:code]
@beta = Betum.where(:code => params[:code]).first
if @beta
@beta.update_all("shared = shared + 1", ["code >= ?", params[:code]])
end
end
def city
I18n.t(:city).map { |key, value| [value, key] }
end