gregbell/active_admin — Issue #1119: Semantic fields_for deep nested form
Author: EnotPoloskun
Created: 2012-03-09 15:28:03+00:00
State: open

Hello, I have a problem

I have a model "page" with code

```ruby
has_many :working_date_times
accepts_nested_attributes_for :working_date_times
```
and a model "working_date_times" with code

```ruby
belongs_to :page
```

This model have fields

```ruby
class CreateWorkingDateTimes < ActiveRecord::Migration
def change
create_table :working_date_times do |t|
t.string :from_time
t.string :to_time
t.integer :page_id
t.integer :working_day
t.timestamps
end

add_index :working_date_times, :page_id
end
end
```
and in admin/pages.rb I have

```ruby
f.semantic_fields_for :working_date_times, f.object.working_date_times.where(:working_day => 1).first || f.object.working_date_times.new(:working_day => 1) do |cw|
cw.input :from_time
cw.input :to_time
cw.input :working_day
end
```
but it doesnt do anything, it doesnt generate any html. What I am doing wrong? Thanks in advance.