I am new to rails. I have tried Google searches, checked the tips and
doco and can't find the answer to a simple question.
I have a table called "Activity" that I want to rename so I can use
RubyOnRails but I don't know whether the plural form should be
"Activitys" or "Activities".
I am new to rails. I have tried Google searches, checked the tips and
doco and can't find the answer to a simple question.
I have a table called "Activity" that I want to rename so I can use
RubyOnRails but I don't know whether the plural form should be
"Activitys" or "Activities".
$ script/console
Loading development environment.
"activity".pluralize
=> "activities"
so you can name your table 'activities' (downcased)
Note that if the pluralization didn't fit to you, you can change it
with Inflector (see config/environment.rb explanations)
I am new to rails. I have tried Google searches, checked the tips and
doco and can’t find the answer to a simple question.
I have a table called “Activity” that I want to rename so I can use
RubyOnRails but I don’t know whether the plural form should be
“Activitys” or “Activities”.
Hey Simon! Check this out:
jeremy@ks editors $ ./script/console
Loading development environment.
“activity”.pluralize
=> “activities”
The Rails console is your new best friend. It’s just the Ruby
interactive shell (irb) with your Rails app already all loaded up for
you to play with interactively.
You can even create classes dynamically and see the results:
class Activity < ActiveRecord::Base; end
=> nil
Activity.table_name
=> “activities”
Activity.columns
=> [would have the columns here if I had an activities table]
Can someone illuminate me on what to do?
Take yourself out for a beer to celebrate your ./script/console discovery.
I am not a database beginner (I have been using Oracle for nearly 20
years) though I am a Ruby novice. I know enough about web development
to make a real pro wince! I am at home in most data modelling tools
(but a UML novice). So, anyone recommend a book or books that will get
me up and running fast I would be appreciative.
Hey Simon, I would highly recommend, at a minimum, getting a copy of
the PDF both 'Programming Ruby' and 'Agile Web Development with Rails
2ed' from pragmaticprogrammer.com.