Blogpost.create(:title => "my title", :desc => "my
desc") ... is this
what you''re after for?
On Sep 6, 2:00 pm, Aruna Chinnamuthu
<li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>
wrote:> Hi ,
>
> I am new to ROR..
>
> I am trying to write a ruby code for the already existing API for blogs
> .
>
> For the create action in my blogpost.rb model file
>
> validates_presence_of :title, :category_id, :user_id
> validates_length_of :title, :in => 8..140, :too_short => "is
too
> short", :too_long => "is too long (max 140 chars)"
>
> How to write a Ruby code in console for the creation of a blogpost ..
>
> Where my Blogpost table has (id,title,desc,cat_id,,,)
>
> and title and desc are mandatory..
> --
> Posted viahttp://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.