Check out ProductsController # index
also please
On Wed, Aug 4, 2010 at 12:30 PM, Musdev Musdev <[email protected]> wrote:
> I get this Error message in my browser
> SyntaxError in ProductsController#index
>
> /Users/musdev/work/depot/app/models/product.rb:11: Invalid char `\x1B'
> in expression
>
>
> The code in my product.rb file
>
> class Product < ActiveRecord::Base
> validates_presence_of :title, :description, :image_url
> validates_numericality_of :price
> validate :price_must_be_at_least_a_cent
> validates_uniqueness_of :title
> validates_format_of :image_url,
> :with => %r{\.(gif|jpg|png)$}i,
> :message => 'must be URL for GIF, JPG' +
> 'or PNG image.'
> end
> def self.find_products_for_sale
> find(:all, :order => "title")
> end
>
>
> def price_must_be_at_least_a_cent
> errors.add(:price, 'should be at least 0.01') if price.nil? ||
> price < 0.01
> end
>
> what does this mean? I dont see anything on that line
>
> Regards
> --
> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
--
Thanks:
Rajeev sharma
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.