Displaying 20 results from an estimated 50000 matches similar to: "Scaffolding and ActiveRecord in Rails 2"
2009 Jul 04
3
scaffolding
hi , i used the folllwing command to scaffold,
G:\my\webblog>ruby script/generate scaffold webblog id:integer
title:string body
:text created_at:datetime
after when i migrate with the follwing command
rake db:migrate
i got the error as
(in G:/my/webblog)
== 1 CreateWebblogs: migrating
================================================
-- create_table(:webblogs)
rake aborted!
Mysql::Error:
2010 Jul 04
3
Generated By handling CRUD Scaffold
Good afternoon.
I have two questions:
First question:
Can be defined at the time that I''m generating the scaffold the size
of
a string?
For example name:string (50)?
Second question:
I wonder how to proceed correctly to include new
fields starting at a CRUD generated by scaffold.
Example:
First step (I use):
script/generate scaffold User name:string login:string
Second step (I add
2006 Apr 04
4
How to read rails documentation
One of the criticism I have heard about rails is that the documentation is
bad. I must admit I have a hard time trying to follow it and I wonder if
anyone can shed some light on it for me. For example, I am looking at the
schema.rb file generated and I noticed this line:
create_table "accounts", :force => true do |t|
I thought to myself, what does :force => true mean? So I
2006 Mar 09
8
Problem with scaffolding and table name
Hello, i''m new in ruby rails framework. I have the following problem. I
try to create a scaffold
for a certain model of my db, but since ruby rails doesn''t assume the
table name corectly (its incidents_reported )
i get errors ....
Besides renaming the table :) is there a way to ''tell'' ruby rails the
name of the table?
I haven''t been able to find any
2008 Oct 26
3
Undefined method f_title
Hi,
This is my migration:
class CreateSampleForms < ActiveRecord::Migration
def self.add_data
SampleForm.create(:name => ''Default (Empty)'', :f_type => ''Default
(Empty)'', :description => ''Use this template to create a blank form.'')
end
def self.up
create_table :sample_forms do |t|
t.string :name, :null =>
2007 Sep 19
5
problem after scaffolding
hi guys,
I am having problems after scaffolding
I created a db called "requests"
and when i tried to execute the command
script/generate scaffold request
It gave me an error please make sure you have a database request created
before you do this
The db is obviously created; rails cant access it...
so I tried to hack i copied my view model and controller files from my
local deployment to
2006 Mar 28
8
Large Database with lots of tables
Hello all,
I am a rails nuby and I am evaluating using Rails for a new web
application. The application will have a large number of tables (>70)
that will basically mimic a large collection of paper forms that user
would otherwise have to fill out. From what I have read on rails thus
far it seems I would have to create a lot of models and form templates.
Is this common and if so does
2006 Jan 28
10
Rails scaffolding - cannot get access to MySQL
Hi,
A newbie in the RoR world, I''m already more or less stuck when
generating the scaffold for my first tutorial project ...
When I try to generate scaffold code for my version of the ''depot''
application from the ''Agile rails ...'' book, I receive the following
error:
#28000Access denied for user ''bo''@''localhost''
2006 May 20
7
Polymorphic, many-to-many, self-referential data model
No matter what I try I''ve been unable to work how to get this to work with
the cool ActiveRecord helpers. I''m not sure if it''s possible, Josh Susser''s
blog suggests it is, but damned if I can work it out...
I have:
Container which can contain one or more Element. An Element is a polymorph
of either a Container or a Chunk. An Element can exist in one or more
2007 Dec 10
15
Scaffolding for pre-existing database table in 2.0.1
Hi,
first of all I will apologize in advance for my presumably noobish
question, but I''m only starting to learn Rails and am a little
confused with all the changes in 2.0.1. There are as good as no
tutorials out yet and the 2 or 3 screencasts I''ve seen deal with the
creation of both the app and the database.
Now my problem is that I already have a database with a fair amount of
2008 Sep 02
6
Scaffolding
Hello everyone,
Does scaffold still work in the new rails 2.0?
Thank you,
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
2005 Aug 08
7
Problems with ./scripts/generate scaffold
Hi all,
I''m new to rails after having used perl for most of these things, and am
trying to get my head around the generate script for a project playing
around
with.
If I do:
./scripts/generate controller Device
I get app/controllers/device_controller.rb
where I can then add:
scaffold :device
However, if I want to actually generate the scaffolding so I can make
some changes:
2008 Jan 18
15
scaffold :product missing in Rails 2.0.2 version of depot tutorial?
I am getting an error when I try to run the code for the depot
application (page 67 in the Agile Web Development on Rails book, 2nd
edition). I built the complete depot app with Rails 1.2.6, and all
worked well. I then updated to Gem 1.0.1 and RoR 2.0.2, and attempted
to repeat the tutorial, and got this strange behavior.
I used "rails depot --database=mysql" because I have not
2006 Jun 28
9
Scaffold Issue with Postgres
Hi guys,
I''ve been able to successfully install the postgres adapter for a remote
database machine to get rails up. My machine is running on Fedora 2.
Rails version 1.1.2. Is my yml config correct? I am getting this error
when I execute script/generate scaffold service_contents content :
exists app/controllers/
exists app/helpers/
create app/views/spiel
exists
2006 Mar 23
2
Question About Scaffolding for My First Rails App
When using ruby to generate scaffolding, is there an easy way to add
features that would be useful for keeping track of has_many and
belongs_to relations? For example, suppose I have the following:
Users
Sites
Pages
Modules
Each user has many pages, each site has many pages, each page has many
modules, and also the belongs_to relation holds in the opposite order.
I''m using the
2010 Aug 20
2
The M in ORM
Hi everyone,
I am attempting to connect an already existing mysql database with
Rails. For This I can''t use the traditional "generate scaffold" and
"rake db:migrate" because (I think), I''ll loose the data already
existing in that database table. So what I did was, I generated a
scaffold for my table, and instead of running db:migrate, I added a
2006 Aug 13
5
Newbie question: scaffold not working
I went through a tutorial at
http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=1 to get
started with RoR. I really like the idea of the scaffold construct, but
I can''t seem to get it to work the way it was described in the tutorial.
I''ve got a mysql database that is properly configured, and a table
called ''quotes'' with a column called
2008 Jul 13
2
Problem with ActiveRecord::AssociationTypeMismatch
Hi all !
I''ve written a Character model, each character has many Attributes. My
schema.rb looks like this:
create_table "characters", :force => true do |t|
t.string "first_name"
t.string "last_name"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "attributes",
2007 May 28
5
CTI in ActiveRecord
I search an plugin or gem, but don''t find nothing satisfactory. I
believe to be stranger a technology that nails the DRY, have that create
you vary equal tables, instead of using inheritance.
Exists an soluction for this? I want a solution similar to this:
create_table :people |t| do
t.column :name
t.column :address
end
create_table :customer |t| do
t.column :person_id
2008 Apr 30
4
Beginner mysql problem
I am new to rails and have come across a problem with a sample
application I was working on.
When trying to use rake migrate I got the error listed below.
my db file contains the following
class ContactDb < ActiveRecord::Migration
def self.up
create_table "people" do |t|
t.column "id", :integer
t.column "name",