Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

render fields_for once #129

Closed
tbohr opened this Issue · 3 comments

4 participants

@tbohr

Hello,

can you give me a hint how i render "fields_for" subform once if model is empty?
A user has to click once before he can fill the form....

Is it better with jQuery or ruby?

Thanks!!!!!!!!

@grebsle

In your controller add
def new
@record = Record.new
1.time { @record.plural_association_name.build }
end

@nacengineer

not trolling but I think this supposed to be 1.times not 1.time at least in Ruby 1.9.3-p125.

@lest
Collaborator

@tbohr You can build records in the controller like @netyciukas suggested.

@lest lest closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.