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

We should document the existance of new_resource #1605

Closed
nickcharlton opened this issue Apr 6, 2020 · 5 comments · Fixed by #1634
Closed

We should document the existance of new_resource #1605

nickcharlton opened this issue Apr 6, 2020 · 5 comments · Fixed by #1634
Labels
documentation how to use administrate, examples and common usage

Comments

@nickcharlton
Copy link
Member

In #1097, we refer to the new_resource method which is useful when building out new records in a controller. But it isn't referenced anywhere.

We might like to answer:

  • What problem does it solve?
  • How do you use it?

It'd be best if we added it to a "Customising Administrate" or "Internals" section, or similar.

@nickcharlton nickcharlton added the documentation how to use administrate, examples and common usage label Apr 6, 2020
@pablobm
Copy link
Collaborator

pablobm commented Apr 10, 2020

There are a few hooks in Administrate::ApplicationController that we don't document. Currently, the page Customizing controller actions is the closer we have, I think. This in turn is an outdated version of the directions included with automatically generated controllers: https://github.com/thoughtbot/administrate/blob/master/lib/generators/administrate/dashboard/templates/controller.rb.erb

I think we have two problems regarding documentation of our APIs:

  1. Documentation out of sync.
  2. Not clear where to add documentation when anything is added.
  3. Duplication (eg: doc page and generator).

An idea would be:

  1. Annotate the API using RDoc or similar.
  2. Use this to generate part of our documentation.
  3. Replace other instance (eg: comments in generated code) with links to this documentation.

I think that would ease the three problems I list above. What do you think?

@nickcharlton
Copy link
Member Author

Yeah, I agree with that. I've generally been a fan of YARD but I don't have very strong opinions on it.

@pablobm
Copy link
Collaborator

pablobm commented Apr 21, 2020

It's been very long since I used any of these tools, so I don't know the difference. Whichever is good for me!

nickcharlton added a commit that referenced this issue May 1, 2020
* Ignores the `doc/` directory so we don't commit the generated docs,
* Includes the existing docs as files, plus the CHANGELOG, CoC, and
  LICENSE.

Fixes: #1605.
@sedubois
Copy link
Contributor

sedubois commented May 9, 2020

FYI a description of how the Rails documentation is generated: https://discuss.rubyonrails.org/t/api-rubyonrails-org-sidebar-rendering/74644/5

@pablobm
Copy link
Collaborator

pablobm commented May 9, 2020

I'm now realising I said "whichever is good for me", and I meant "whichever is good for you works for me", or something like that 😅

nickcharlton added a commit that referenced this issue Aug 14, 2020
* Ignores the `doc/` directory so we don't commit the generated docs,
* Includes the existing docs as files, plus the CHANGELOG, CoC, and
  LICENSE.

Fixes: #1605.
nickcharlton added a commit that referenced this issue Aug 14, 2020
* Ignores the `doc/` directory so we don't commit the generated docs,
* Includes the existing docs as files, plus the CHANGELOG, CoC, and
  LICENSE.

Fixes: #1605
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation how to use administrate, examples and common usage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants