PiRSquared17 / activescaffold

Automatically exported from code.google.com/p/activescaffold
MIT License
0 stars 0 forks source link

Cannot assign label for the columns not exist in database #735

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create a def in model, e.g.
def full_name
  return "#{first_name}, #{last_name}"
end
2. Add full_name to controller, e.g.
active_scaffold :user do |config|
  config.list.columns = [:full_name]
  config.columns[:full_naame].label = "User Name"
end
3. Got error
undefined method `label=' for nil:NilClass

What is the expected output? What do you see instead?

Should show the table as normal.

What version (or revision) of the product are you using?

1.2RC1
If this bug causes an exception, please paste at least the first 20 lines
below.

Original issue reported on code.google.com by idler...@gmail.com on 14 Mar 2010 at 3:20

GoogleCodeExporter commented 9 years ago
First, you have to add the column to config.columns:
config.columns << :full_name

Original comment by sergio.c...@gmail.com on 15 Mar 2010 at 8:39