Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify form generation code #38

Closed
david-a-wheeler opened this issue Sep 24, 2015 · 3 comments
Closed

Simplify form generation code #38

david-a-wheeler opened this issue Sep 24, 2015 · 3 comments
Milestone

Comments

@david-a-wheeler
Copy link
Collaborator

There's a lot of repetition in the Ruby code generating the Rails - simply that (e.g., a separate method for generating the radio buttons).

@david-a-wheeler david-a-wheeler added this to the alpha milestone Oct 1, 2015
@david-a-wheeler
Copy link
Collaborator Author

This is important for making the other changes much easier.

@david-a-wheeler
Copy link
Collaborator Author

There are various ways to implement this in Ruby on Rails, including partial templates and custom helpers.

Since the repeated code is mostly HTML, I think partial templates are the better option in this case. Filenames of partials begin with "_", and get invoked using this kind of format:

<%= render(:partial => "partial_name", :locals => {:f => f}) %>

@david-a-wheeler
Copy link
Collaborator Author

Resolved in commit e364e04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant