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

index page view change(depends on 'rspec_api_documentation' json chan… #28

Closed
wants to merge 1 commit into from

Conversation

adityashedge
Copy link

…ges)

  • added an optional tabular index view.
  • set 'index_view' configuration to 'tabular' to use alternate view.
  • default 'index_view' value is 'regular'.
  • added navbar in 'index_view'.
  • in 'index_view' links are displayed as Http method + Route url on index page.
  • eg: 'GET /api/orders'
  • option to add class to links.
  • updated test cases fixture json.
  • closes adding an optional tabular view for index page. #27

…ges)

- added an optional tabular index view.
- set 'index_view' configuration to 'tabular' to use alternate view.
- default 'index_view' value is 'regular'.
- added navbar in 'index_view'.
- in 'index_view' links are displayed as Http method + Route url on index page.
- eg: 'GET /api/orders'
- option to add class to links.
- updated test cases fixture json.
@adityashedge
Copy link
Author

If someone wants to upgrade to the tabular view but does not want to update 'rspec_api_documentation' gem then all they need to do is override the 'section_hash' method for 'JsonIndex' class to include 'route' and 'method' as show below.

  def section_hash(section) 
    {
      :name => section[:resource_name],
      :examples => section[:examples].map { |example|
        {
          :description => example.description,
          :link => "#{example.dirname}/#{example.filename}",
          :groups => example.metadata[:document],
          :route => example.route,
          :method => example.metadata[:method]
        }
      }
    }
  end  

@oestrich
Copy link
Contributor

Closing due to age.

@oestrich oestrich closed this May 11, 2017
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

Successfully merging this pull request may close these issues.

adding an optional tabular view for index page.
2 participants