Displaying 3 results from an estimated 3 matches for "to_d".
Did you mean:
t_d
2008 Jul 29
1
can't crop images using ImageMagick
...ct I thought I
successfully resized or cropped an image this way, but I can''t seem to
do it now.
Also, the files are in the shared "system" directory of a Capistrano
deployed server.
Here''s my code:
require ''RMagick''
top_square = params[:top_square].to_d
left_square = params[:left_square].to_d
width_square = params[:width_square].to_d
height_square = params[:height_square].to_d
source_file = "#{RAILS_ROOT}/public#{@photo.public_filename}"
destination_file = "#{RAILS_ROOT}/public#{city_photo.public_filename}"
img = Magick::Imag...
2006 Jul 28
6
STRFTIME() why is it not defined
I am trying to take the input from a field in wich the user enters a
date, and formatting it to my time format
if params[:gotcha] != ''''
gotc = params[:date].to_a
gotc.strftime("%m/%d/%y")
end
Yet I get this error:
NoMethodError in AddController#add
undefined method `strftime? for ["00000"]
What''s wrong. I''m positive this method is
2012 Feb 21
0
nil can't be coerced into BigDecimal Options
...odel/line_item.rb
def total_price
line_items.to_a.sum { |item| item.total_price }
end
model/cart.rb
def total_price
product.price * quantity
end
my second option is
def total_price
if product.price
product.price * quantity
else
product.price = "0.0".to_d
end
end
but still this wont work
thanks more power to us!
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3Mb...