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

Generator for adding formats #132

Merged
merged 3 commits into from Apr 7, 2016
Merged

Generator for adding formats #132

merged 3 commits into from Apr 7, 2016

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented Apr 5, 2016

Based on @dsingleton's work for components: alphagov/static#444

Usage: rails generate format [format_name]

Adds the following files:

  • View specific stylesheet (and appends include to application.scss)
  • Format erb template with title, page class, title component and
    description
  • Format presenter
  • Format presenter test
  • Format integration test

Based around these early commits when adding formats:

fofr added 2 commits Apr 5, 2016
Usage: `rails generate format [format_name]`

Adds the following files:
* View specific stylesheet (and appends include to application.scss)
* Format erb template with title, page class, title component and
description
* Format presenter
* Format presenter test
* Format integration test
source_root File.expand_path('../templates', __FILE__)

def copy_format_files
format_name = file_name

This comment has been minimized.

@boffbowsh

boffbowsh Apr 5, 2016
Contributor

It'd be good to call underscore on this. Rails generators for e.g. model accept both forms and turn them into the correct thing, e.g. rails g model FooBar is equivalent to rails g model foo_bar.

This comment has been minimized.

@fofr

fofr Apr 5, 2016
Author Contributor

Good point, added in 5792915

Let both of these work correctly:
bundle exec rails generate format format_name
bundle exec rails generate format FormatName
@boffbowsh
Copy link
Contributor

@boffbowsh boffbowsh commented Apr 5, 2016

👍 but will let @dsingleton look first and merge

@boffbowsh
Copy link
Contributor

@boffbowsh boffbowsh commented Apr 7, 2016

Nah, let's merge it

@boffbowsh boffbowsh merged commit 312003f into master Apr 7, 2016
1 check passed
1 check passed
@govuk-ci
default Build #586 succeeded on Jenkins
Details
@boffbowsh boffbowsh deleted the format-generator branch Apr 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants