[Rails] validates problem

2009-03-02 Thread Ga Ga
Validation: validates_presence_of :name validates_length_of :name, :maximum = 150 validates_inclusion_of :category, :in = %w( X Y XY ) validates_length_of :gender, :maximum = 3 validates_length_of :tag, :within = 1..10 Data sended data: !map:HashWithIndifferentAccess name: Bond

[Rails] Form helper

2009-03-02 Thread Ga Ga
How can I set a default value: M ? How can I order optios? %= select( user, sex, { t(male) = M, t(female) = F }, {:include_blank = true} ) % -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[Rails] Re: validates problem

2009-03-02 Thread Ga Ga
MaD wrote: can you set a debugger in your Controller/Model to see what is actually received? How can I se a debbuger? validates_inclusion_of :category, :in = %w( X, Y, XY ) validates_length_of :gender, :maximum = 3, :allow_nil = true validates_length_of :tag, :in = 1..10 gender works now,

[Rails] Page was generated in 0. XXX seconds

2009-02-28 Thread Ga Ga
How can I add a Page was generated in 0.XXX seconds counter to page? -- 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

[Rails] SQL search

2009-02-27 Thread Ga Ga
How I write it in rails format? Articles.find( ) SELECT *, MATCH(title, body) AGAINST('$keyword') AS score FROM articles WHERE MATCH(title, body) AGAINST('$keyword') ORDER BY score DESC -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You

[Rails] Re: SQL search

2009-02-27 Thread Ga Ga
I get: undefined method `sanitize_sql' -- 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

[Rails] Re: SQL search

2009-02-27 Thread Ga Ga
Ga Ga wrote: I get: undefined method `sanitize_sql' Help ? -- 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

[Rails] Re: SQL search

2009-02-27 Thread Ga Ga
Rob Biedenharn wrote: On Feb 27, 2009, at 11:42 AM, Rob Biedenharn wrote: match_part = self.class. Rob Biedenharnhttp://agileconsultingllc.com r...@agileconsultingllc.com Sorry, if you look at the docs, sanitize_sql is a protected class method of ActiveRecord::Base Is there