[Rails] Re: New to Ruby on Rails - Assigning variation (like size or color) to products

2012-02-25 Thread Eric L.
Top 3 book for Rails/Ruby Development 1. The Ruby Programming Language by David Flanagan Yukihiro Matsumoto or 1. Programming Ruby 1.9 (3rd edition): The Pragmatic Programmers' Guide by by Dave Thomas, with Chad

[Rails] save doesn't work in migration

2009-05-06 Thread Eric L.
I'm writing a migration to merge my first and last name fields into a single name field. However, writing to the new name column doesn't work within the migration. Why is this so? def self.up add_column :users, :name, :string for user in User.all user.name = user.first_name + ' ' +

[Rails] Re: save doesn't work in migration

2009-05-06 Thread Eric L.
Never mind, after some Googling, found reset_column_info to be my answer. On May 6, 10:18 pm, Eric L. eli...@gmail.com wrote: I'm writing a migration to merge my first and last name fields into a single name field.  However, writing to the new name column doesn't work within the migration

[Rails] Question regarding has_one and association_build

2009-05-05 Thread Eric L.
In the doc, there's is a note saying association_build only works if an association already exists. It will NOT work if the association is nil. But in my test, it works fine when the association is nil. For example, class Post ActiveRecord::Base has_one :author def after_initialize

[Rails] Resource-based routing and controller module

2009-04-22 Thread Eric L.
I have a Request resource in my application. A Request is created by users of the system, but managed by administrators. For example, user creates a request to fix a chair, and administrator views and edits the request. As a result, I want to create two Request controllers:

[Rails] Re: Security risks of cookie-based session storage

2009-02-23 Thread Eric L.
Good point. I realized risk #1 could be reduced by storing the secret in a secure place on the deployment server rather than under source control. On Feb 21, 3:20 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Feb 21, 5:06 pm, Eric L. eli...@gmail.com wrote: Should I be concerned

[Rails] Security risks of cookie-based session storage

2009-02-21 Thread Eric L.
Should I be concerned if I am using the default cookie-based session storage for a high security application? Nothing sensitive will be stored on the cookie, but it's critical that one user cannot gain access to another user's account. The security risks I see with cookie-based storage are: 1.

[Rails] Re: guides on css strategy

2009-02-21 Thread Eric L.
I had the same question when I was starting out with CSS. A lot of is simply trial and error, and you figure out what is best. Buy a good book on CSS (I read Bullet Proof CSS design), and that will give you some guidance as to what's the best class/id naming style. In general I follow these