Displaying 11 results from an estimated 11 matches for "createproducts".
2007 Aug 12
10
about chinese display
hello:
I have built a project with Instant Rails.Now only a database and a
scaffold based on a product model have finished.But when i inputted
"../admin/list" in my browser,i found my chinese characters cound not
display normally.Then i made five steps:
1 ajusting encoding in my browser menu
2 in "C:\InstantRails\conf_files\my.ini"directory,making sure
2008 Dec 20
3
rake aborted (wrong number of arguments)
...re to get some columns in my database. I
generated a model called ''product'' then I edited
''db/001_create_products.rb'' to have a few columns but when I try to
migrate I get this error:
bio4054059:depot rmorourk$ rake db:migrate
(in /Users/rmorourk/Sites/depot)
== CreateProducts: migrating
==================================================
-- create_table(:products)
rake aborted!
wrong number of arguments (1 for 2)
(See full trace by running task with --trace)
bio4054059:depot rmorourk$
I copied the code exactly for the 001_create_products.rb not really sure
what it mean...
2011 Mar 22
2
Problems with SQLite3
Hi!
I''ve got a very strange problem. Suddenly the SQLite3 Backend stopped
working.
Example 1:
> rake db:rollback
== CreateProducts: reverting
=================================================
-- drop_table(:products)
rake aborted!
An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: near "CASCADE": syntax error: DROP TABLE
"products" CASCADE
I googled for this error messag...
2006 Aug 15
3
Rake Problem
...migrate
(in C:/xxx/RoR/depot)
rake aborted!
undefined method `each'' for #<Mysql:0x38da498>
any idea what i might be doing wrong?
I can connect to the database fine from command prompt with the username
and password set in my database .yml file.
the migration script is below
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
# t.column :name, :string
t.column :title, :string
t.column :description, :text
t.column :image_url, :string
end
end
def self.down
drop_table :products
end
end
--
Posted via http://www.ru...
2006 Jun 06
0
Re: [ocruby] iteration A1 in ebook: scaffold gets: routing error
...root create ${name}_production
echo rails
rails.cmd $name
cd $name
echo rake db:migrate
rake.bat db:migrate
echo script/generate model Product
ruby script/generate model Product
echo "edit migration file"
#read x
cat > $base/$name/db/migrate/001_create_products.rb << !!eof
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.column :title, :string
t.column :description, :text
t.column :image_url, :string
end
end
def self.down
drop_table :products
end
end
!!eof
echo rake db:migrate
rake.bat db:migrate...
2007 Feb 09
0
rake aborted!!
OK, I''ve created the following migration
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.column :title, :string
t.column :description, :text
t.column :image_url, :string
end
end
def self.down
drop_table :products
end
end
This has created a table no problem. I''ve t...
2006 Oct 10
3
Dynamic fields and inheritance
...roperty(property, value)}
end
end
def get_property (property)
self[:data][property] if self[:data]
end
def set_property (property, value)
self[:data] = Hash.new unless self[:data]
self[:data][property] = value
end
end
Here''s the migration for said model:
class CreateProducts < ActiveRecord::Migration
def self.up
create_table :products do |t|
t.column :name, :string
t.column :type, :string
t.column :data, :string
end
end
def self.down
drop_table :products
end
end
An example of a couple subclasses are:
class Book < Product...
2006 Jul 13
8
can''t convert true into integer
I have a method:
? def reduceProuctInventoryBy(product_id, reduction)
? ? t=Product.find(:first, :conditions =>["id = ?", product_id])
? ? t.qty=(t.qty-reduction)
? ? t.save
? end
and the model:
class Product < ActiveRecord::Base
? validates_presence_of :qty, :specialDescription
? validates_numericality_of :qty
end
but when i run my method, I get this:
"can''t
2007 Oct 02
11
rake db:migrate fail! bad descriptor
Dear All,
I am just getting into Ruby on Rails, after successfully failing at
getting any other programming language to work locally. RoR appears to
be a repeat! One problem I keep running into is getting a database up
and running.
I''m working out of Windows XP.
I installed MySQL, it works, runs, will create tables etc. BUT, when I
do rake db:migrate...it fails and tells me I have a
2006 Jun 06
15
error working through Agile !!!
Hi everyone,
I''m working my way thru the ''Depot'' project from Agile Web Development
with Rails.
I got to the bit where I type:
ruby script/generate scaffold Product admin
And I get the following error:
error Before updating scaffolding from new DB schema, try creating a
table for your model (Product) ( on the last line ! )
Now I have followed everything as
2006 Apr 03
18
newbie generate scaffold
Hi Guys
First time on the list and pretty new to the rails way of doing
things, yup I know sorry.. another newbie!
anyway, apologies out of the way, this is the problem I am having...
I have purchased the "Agile Development with Rails" book and have
just started running through the ''Depot'' demo application.
I have got to page 57...
I have my project files all