2009/9/29 Tushar Gandhi <[email protected]>:
>
> Hi,
> I have a question that Is it possible to add record into the database
> table without adding the model for that?
>
> E.g. I have a table customers. And I haven't created a model for that.
> Can I add a record into that table bu doing "cust=Custome.new cust.save"
>
You can't do Customer.new unless the Customer class is defined.
Otherwise how would ruby know what to do?
All you need is models/customer.rb containing

class Customer < ActiveRecord::Base
end

Provided the customer table meets the normal Rails conventions
(primary key id and so on).

Colin

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to