Replace nested forms with form objects #26

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
1 participant
Owner

jayroh commented Apr 28, 2014

accepts_nested_attributes for is a poor solution to the nested objects in
forms problem so replacing that functionality, along with the nested_form gem,
is a must.

  • Add app/forms directory and autoload it
  • Remove nested_form
  • Replace all instances of nested_form_for with form_for
  • Tighten up the permissions for strong params being used
  • Remove accepts_nested_attributes_for in the topic model
  • Add NewTopic and PrivateTopic form objects
  • Remove nested attributes from setup controller
  • Delete form partial that's only used once.

Misc:

  • Standardize form object naming as form and not f
  • Remove multipart: true html options for the forms
  • Remove unnecessary .topic_form class on form tags
  • Chill with the nested partials
@jayroh jayroh [JRO] Replace nested forms with form objects
accepts_nested_attributes for is a poor solution to the nested objects in forms problem so replacing that functionality, along with the nested_form gem, is a must.

* Add app/forms directory and autoload it
* Remove nested_form
* Replace all instances of nested_form_for with form_for
* Tighten up the permissions for strong params being used
* Remove accepts_nested_attributes_for in the topic model
* Add NewTopic and PrivateTopic form objects
* Remove nested attributes from setup controller
* Delete form partial that's only used once.

Misc:

* Standardize form object naming as `form` and not `f`
* Remove `multipart: true` html options for the forms
* Remove unnecessary `.topic_form` class on form tags
* Chill with the nested partials

Rename NewTopic -> TopicForm
51bf241
Owner

jayroh commented Apr 28, 2014

@TheDudeWithTheThing something to have a look at if/when you want.

Up next: splitting up the topic/private topic STI junk

jayroh added some commits May 3, 2014

@jayroh jayroh [JRO] Format code and fix ordering issue in spec
* Some fixes to the formatting in this file while I'm in here (thx
  rubocop!)
* A spec down below was setting the cofniguration on the Thredded
  singleton and wasn't cleaning up after itself. Therefore, depending on
  the order of the tests being run, it would bleed over into subsequent
  tests and cause failure. This commit resets `Thredded.user_path` after
  it is changed
c95e808
@jayroh jayroh [JRO] Fix breaking topics#edit form
`category_options` was being called on a Topic object, and the method
doesn't exist. But decorating the topic, and adding the method to the
decorator fixes it.

Also add correct, and uniform, css classes to the div wrapping around
the topic edit form.
1897061

jayroh closed this May 3, 2014

jayroh deleted the jro-remove-nested-forms branch May 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment