Comments inserted below.
Did the generator add the validations for that attribute?
Did it add the code in the toy.rb that implements the business logic
involving that attribute?
Did it add the attribute to the views that do not just consist of the
simplistic tables and so on generated by
On 5 June 2015 at 22:21, kenatsun kenat...@gmail.com wrote:
All of the changes were to files that specifically mentioned the model's
attributes (aka the table's columns), and all the changes consisted of
adding a mention of the new column. For example, the auto-edit of
show.json.jbuilder when
On 5 June 2015 at 21:25, kenatsun kenat...@gmail.com wrote:
...
Were not all of these 9 edits necessary to weave the new database column
into my app?
Diff the files and see what the changes were.
Colin
--
You received this message because you are subscribed to the Google Groups Ruby
on
Scott Colin ~
Perhaps this conversation has reached the end of its useful life. But in
case there still is anything left to be learned, let me respond to a couple
of your comments.
Why on earth would you keep re-generating scaffolds over and over???
[Scott]
Because generators, when they
All of the changes were to files that specifically mentioned the model's
attributes (aka the table's columns), and all the changes consisted of
adding a mention of the new column. For example, the auto-edit of
*show.json.jbuilder* when I added the *size *attribute changed
json.extract! @toy,
All of the changes were to files that specifically mentioned the model's
attributes (aka the table's columns), and all the changes consisted of
adding a mention of the new column. For example, the auto-edit of
*show.json.jbuilder* when I added the *size *attribute changed
json.extract! @toy,
Yeah, I figured something like that was the case. Probably that's the case
with most/all Rails generators (like most of the generators in the world) -
they're good for a one-time kick-start, but not much good after that.
Still, a generator that could write on something other than a blank slate
On 4 June 2015 at 21:21, kenatsun kenat...@gmail.com wrote:
...
However: This process has only a limited ability to update the Rails
objects to handle the database change while preserving manually entered
changes to them. Specifically: For each Rails file where the new
(generated) version
*Next step*: I have succeeded in adding a column to a database table, then
using the generator tools to update the Rails objects that implement that
model. The process, which I share for what it's worth to others, is:
1. Add attribute *toys.color* (text):
sqlite ALTER TABLE toys ADD
I think you just need to create Toy model and then use scaffold controller
http://stackoverflow.com/questions/493/using-rails-generate-scaffold-when-model-already-exists
On Mon, Jun 1, 2015 at 7:06 AM, kenatsun kenat...@gmail.com wrote:
My next question is whether it is possible to sue the
On Sun, May 31, 2015 at 5:06 PM, kenatsun kenat...@gmail.com wrote:
10. An odd note is that there still is no schema.rb file in x/db/. If this
is what Rails uses as its database catalog, is the lack of it going to
cause trouble down the road?
Possibly, but you can use `rake db:schema:dump`
Thank you, byakugie* ~*
Your link led me to the gem schema-to-scaffold, which enabled the
following scenario:
The aim is to get all the components generated automatically, but based on
the database schema. I did it my using the gem *schema_to_scaffold, *which
simply generates a script (one
Thanks, Hassan ~ The rake command does the job of building (and updating)
schema.rb. ~ Ken
On Monday, June 1, 2015 at 2:06:45 PM UTC-4, Hassan Schroeder wrote:
On Sun, May 31, 2015 at 5:06 PM, kenatsun kena...@gmail.com javascript:
wrote:
10. An odd note is that there still is no
Yaay! I'm happy to report success with my first attempt to make a Rails
app that works from an existing database.
This first experiment used (a) the simplest instructions I could find
(basically, Hassan's); (b) a streamlined version of the Getting Started
Guide process for setting up a
Thanks a million to Scott, Hassan, Colin, for this rich feast of
possibilities! It's gonna take me some time to digest. Then I'll be back
with the solutions I'm finding and/or with more questions.
~ Ken
On Friday, May 22, 2015 at 3:44:34 PM UTC-4, kenatsun wrote:
I'm evaluating Rails (vs
You don't always have to work with Rails functionality to utilize a
database, not sure always true for PostgreSQL. The critical aspect is how
you define your database connectivity in config/database.yml.
Perhaps helpful, check out brilliant Ryan Bates' RailsCast:
I know how to *connect *a Rails app to a PG database. My question is about
how to align the Rails *contents *(model definitions) with the database
contents (table definitions), so that the app can read from and write to
the tables.
It think perhaps you're answering yes to my question 2 -
17 matches
Mail list logo