haml-rails 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +51 -32
- data/Gemfile +17 -0
- data/README.md +8 -3
- data/haml-rails.gemspec +3 -2
- data/lib/generators/haml/controller/controller_generator.rb +2 -0
- data/lib/generators/haml/mailer/mailer_generator.rb +2 -0
- data/lib/generators/haml/scaffold/scaffold_generator.rb +25 -10
- data/lib/generators/haml/scaffold/templates/5_1/_form.html.haml +26 -0
- data/lib/generators/haml/scaffold/templates/5_1/edit.html.haml +7 -0
- data/lib/generators/haml/scaffold/templates/5_1/index.html.haml +25 -0
- data/lib/generators/haml/scaffold/templates/5_1/new.html.haml +5 -0
- data/lib/generators/haml/scaffold/templates/5_1/show.html.haml +11 -0
- data/lib/generators/haml/scaffold/templates/5_2/_form.html.haml +26 -0
- data/lib/generators/haml/scaffold/templates/5_2/edit.html.haml +7 -0
- data/lib/generators/haml/scaffold/templates/5_2/index.html.haml +25 -0
- data/lib/generators/haml/scaffold/templates/5_2/new.html.haml +5 -0
- data/lib/generators/haml/scaffold/templates/5_2/show.html.haml +11 -0
- data/lib/generators/haml/scaffold/templates/6_0/_form.html.haml +29 -0
- data/lib/generators/haml/scaffold/templates/6_0/edit.html.haml +7 -0
- data/lib/generators/haml/scaffold/templates/6_0/index.html.haml +25 -0
- data/lib/generators/haml/scaffold/templates/6_0/new.html.haml +5 -0
- data/lib/generators/haml/scaffold/templates/6_0/show.html.haml +18 -0
- data/lib/generators/haml/scaffold/templates/6_1/_form.html.haml +29 -0
- data/lib/generators/haml/scaffold/templates/6_1/edit.html.haml +7 -0
- data/lib/generators/haml/scaffold/templates/6_1/index.html.haml +25 -0
- data/lib/generators/haml/scaffold/templates/6_1/new.html.haml +5 -0
- data/lib/generators/haml/scaffold/templates/6_1/show.html.haml +18 -0
- data/lib/generators/haml/scaffold/templates/7_0/_form.html.haml +29 -0
- data/lib/generators/haml/scaffold/templates/7_0/edit.html.haml +10 -0
- data/lib/generators/haml/scaffold/templates/7_0/index.html.haml +11 -0
- data/lib/generators/haml/scaffold/templates/7_0/new.html.haml +8 -0
- data/lib/generators/haml/scaffold/templates/7_0/partial.html.haml +14 -0
- data/lib/generators/haml/scaffold/templates/7_0/show.html.haml +10 -0
- data/lib/generators/haml/scaffold/templates/7_1 +1 -0
- data/lib/generators/haml/scaffold/templates/7_2/_form.html.haml +29 -0
- data/lib/generators/haml/scaffold/templates/7_2/edit.html.haml +12 -0
- data/lib/generators/haml/scaffold/templates/7_2/index.html.haml +13 -0
- data/lib/generators/haml/scaffold/templates/7_2/new.html.haml +10 -0
- data/lib/generators/haml/scaffold/templates/7_2/partial.html.haml +14 -0
- data/lib/generators/haml/scaffold/templates/7_2/show.html.haml +10 -0
- data/lib/generators/haml/scaffold/templates/8_0 +1 -0
- data/lib/generators/haml/scaffold/templates/_form.html.haml +1 -0
- data/lib/generators/haml/scaffold/templates/edit.html.haml +1 -0
- data/lib/generators/haml/scaffold/templates/index.html.haml +1 -0
- data/lib/generators/haml/scaffold/templates/new.html.haml +1 -0
- data/lib/generators/haml/scaffold/templates/partial.html.haml +1 -0
- data/lib/generators/haml/scaffold/templates/show.html.haml +1 -0
- data/lib/haml-rails/version.rb +3 -1
- data/lib/haml-rails.rb +2 -0
- data/lib/rails/generators/haml/application_layout/application_layout_generator.rb +8 -3
- data/test/fixtures/routes.rb +2 -0
- data/test/lib/generators/haml/controller_generator_test.rb +2 -0
- data/test/lib/generators/haml/mailer_generator_test.rb +2 -0
- data/test/lib/generators/haml/scaffold_generator_test.rb +2 -0
- data/test/lib/generators/haml/scaffold_template_contents_test.rb +76 -0
- data/test/test_helper.rb +30 -7
- metadata +45 -31
- data/Appraisals +0 -19
- data/gemfiles/rails_5_1.gemfile +0 -8
- data/gemfiles/rails_5_2.gemfile +0 -8
- data/gemfiles/rails_6_0.gemfile +0 -8
- data/gemfiles/rails_6_1.gemfile +0 -8
- data/gemfiles/rails_7_0.gemfile +0 -8
- data/lib/generators/haml/scaffold/templates/_form.html.haml +0 -15
- data/lib/generators/haml/scaffold/templates/edit.html.haml +0 -7
- data/lib/generators/haml/scaffold/templates/index.html.haml +0 -25
- data/lib/generators/haml/scaffold/templates/new.html.haml +0 -5
- data/lib/generators/haml/scaffold/templates/show.html.haml +0 -11
@@ -0,0 +1,11 @@
|
|
1
|
+
%p{style: "color: green"}= notice
|
2
|
+
|
3
|
+
%h1 <%= human_name.pluralize %>
|
4
|
+
|
5
|
+
%div{id: "<%= plural_table_name %>"}
|
6
|
+
- @<%= plural_table_name %>.each do |<%= singular_table_name %>|
|
7
|
+
= render <%= singular_table_name %>
|
8
|
+
%p
|
9
|
+
= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(singular_table_name) %>
|
10
|
+
|
11
|
+
= link_to "New <%= human_name.downcase %>", <%= new_helper(type: :path) %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%div{id: dom_id(<%= singular_name %>)}
|
2
|
+
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
3
|
+
%p
|
4
|
+
%strong <%= attribute.human_name %>:
|
5
|
+
<% if attribute.attachment? -%>
|
6
|
+
= link_to <%= singular_name %>.<%= attribute.column_name %>.filename, <%= singular_name %>.<%= attribute.column_name %> if <%= singular_name %>.<%= attribute.column_name %>.attached?
|
7
|
+
<% elsif attribute.attachments? -%>
|
8
|
+
- <%= singular_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>|
|
9
|
+
%div= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %>
|
10
|
+
<% else -%>
|
11
|
+
= <%= singular_name %>.<%= attribute.column_name %>
|
12
|
+
<% end -%>
|
13
|
+
|
14
|
+
<% end -%>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%p{style: "color: green"}= notice
|
2
|
+
|
3
|
+
= render @<%= singular_table_name %>
|
4
|
+
|
5
|
+
%div
|
6
|
+
= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>
|
7
|
+
|
|
8
|
+
= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>
|
9
|
+
|
10
|
+
= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete
|
@@ -0,0 +1 @@
|
|
1
|
+
7_0
|
@@ -0,0 +1,29 @@
|
|
1
|
+
= form_with(model: <%= model_resource_name %>) do |form|
|
2
|
+
- if <%= singular_table_name %>.errors.any?
|
3
|
+
%div{style: "color: red"}
|
4
|
+
%h2= "#{pluralize(<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:"
|
5
|
+
|
6
|
+
%ul
|
7
|
+
- <%= singular_table_name %>.errors.each do |error|
|
8
|
+
%li= error.full_message
|
9
|
+
|
10
|
+
<% attributes.each do |attribute| -%>
|
11
|
+
%div
|
12
|
+
<% if attribute.password_digest? -%>
|
13
|
+
= form.label :password, style: "display: block"
|
14
|
+
= form.password_field :password
|
15
|
+
|
16
|
+
%div
|
17
|
+
= form.label :password_confirmation, style: "display: block"
|
18
|
+
= form.password_field :password_confirmation
|
19
|
+
<% elsif attribute.attachments? -%>
|
20
|
+
= form.label :<%= attribute.column_name %>, style: "display: block"
|
21
|
+
= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true
|
22
|
+
<% else -%>
|
23
|
+
= form.label :<%= attribute.column_name %>, style: "display: block"
|
24
|
+
= form.<%= attribute.field_type %> :<%= attribute.column_name %>
|
25
|
+
<% end -%>
|
26
|
+
|
27
|
+
<% end -%>
|
28
|
+
%div
|
29
|
+
= form.submit
|
@@ -0,0 +1,12 @@
|
|
1
|
+
- content_for :title, "Editing <%= human_name.downcase %>"
|
2
|
+
|
3
|
+
%h1 Editing <%= human_name.downcase %>
|
4
|
+
|
5
|
+
= render "form", <%= singular_table_name %>: @<%= singular_table_name %>
|
6
|
+
|
7
|
+
%br
|
8
|
+
|
9
|
+
%div
|
10
|
+
= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>
|
11
|
+
|
|
12
|
+
= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
%p{style: "color: green"}= notice
|
2
|
+
|
3
|
+
- content_for :title, "<%= human_name.pluralize %>"
|
4
|
+
|
5
|
+
%h1 <%= human_name.pluralize %>
|
6
|
+
|
7
|
+
%div{id: "<%= plural_table_name %>"}
|
8
|
+
- @<%= plural_table_name %>.each do |<%= singular_table_name %>|
|
9
|
+
= render <%= singular_table_name %>
|
10
|
+
%p
|
11
|
+
= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(singular_table_name) %>
|
12
|
+
|
13
|
+
= link_to "New <%= human_name.downcase %>", <%= new_helper(type: :path) %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
- content_for :title, "New <%= human_name.downcase %>"
|
2
|
+
|
3
|
+
%h1 New <%= human_name.downcase %>
|
4
|
+
|
5
|
+
= render "form", <%= singular_table_name %>: @<%= singular_table_name %>
|
6
|
+
|
7
|
+
%br
|
8
|
+
|
9
|
+
%div
|
10
|
+
= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%div{id: dom_id(<%= singular_name %>)}
|
2
|
+
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
3
|
+
%p
|
4
|
+
%strong <%= attribute.human_name %>:
|
5
|
+
<% if attribute.attachment? -%>
|
6
|
+
= link_to <%= singular_name %>.<%= attribute.column_name %>.filename, <%= singular_name %>.<%= attribute.column_name %> if <%= singular_name %>.<%= attribute.column_name %>.attached?
|
7
|
+
<% elsif attribute.attachments? -%>
|
8
|
+
- <%= singular_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>|
|
9
|
+
%div= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %>
|
10
|
+
<% else -%>
|
11
|
+
= <%= singular_name %>.<%= attribute.column_name %>
|
12
|
+
<% end -%>
|
13
|
+
|
14
|
+
<% end -%>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
%p{style: "color: green"}= notice
|
2
|
+
|
3
|
+
= render @<%= singular_table_name %>
|
4
|
+
|
5
|
+
%div
|
6
|
+
= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>
|
7
|
+
|
|
8
|
+
= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>
|
9
|
+
|
10
|
+
= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete
|
@@ -0,0 +1 @@
|
|
1
|
+
7_2
|
@@ -0,0 +1 @@
|
|
1
|
+
8_0/_form.html.haml
|
@@ -0,0 +1 @@
|
|
1
|
+
8_0/edit.html.haml
|
@@ -0,0 +1 @@
|
|
1
|
+
8_0/index.html.haml
|
@@ -0,0 +1 @@
|
|
1
|
+
8_0/new.html.haml
|
@@ -0,0 +1 @@
|
|
1
|
+
8_0/partial.html.haml
|
@@ -0,0 +1 @@
|
|
1
|
+
8_0/show.html.haml
|
data/lib/haml-rails/version.rb
CHANGED
data/lib/haml-rails.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails'
|
2
4
|
require 'shellwords'
|
3
5
|
|
@@ -15,11 +17,14 @@ module Haml
|
|
15
17
|
app_layout_to = ::Rails.root.join(HAML_LAYOUT_PATH).to_s
|
16
18
|
|
17
19
|
if File.exist?(app_layout_from)
|
18
|
-
|
19
20
|
if !File.exist?(app_layout_to)
|
20
21
|
`html2haml #{app_layout_from.shellescape} #{app_layout_to.shellescape}`
|
21
|
-
|
22
|
-
|
22
|
+
if $?.success?
|
23
|
+
puts "Success! app/views/layouts/application.html.haml is created.\n" \
|
24
|
+
"Please remove the erb file: app/views/layouts/application.html.erb"
|
25
|
+
else
|
26
|
+
puts "Error! Failed to execute html2haml command."
|
27
|
+
end
|
23
28
|
else
|
24
29
|
puts "Error! There is a file named app/views/layouts/application.html.haml already."
|
25
30
|
end
|
data/test/fixtures/routes.rb
CHANGED
@@ -0,0 +1,76 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'test_helper'
|
4
|
+
require 'rails/generators/rails/scaffold/scaffold_generator'
|
5
|
+
require 'generators/haml/scaffold/scaffold_generator'
|
6
|
+
require 'action_controller/test_case'
|
7
|
+
|
8
|
+
class Haml::Generators::ScaffoldTemplateContentsTest < Rails::Generators::TestCase
|
9
|
+
destination File.join(Rails.root)
|
10
|
+
tests Rails::Generators::ScaffoldGenerator
|
11
|
+
arguments %w(person name)
|
12
|
+
|
13
|
+
setup :prepare_destination
|
14
|
+
setup :copy_routes
|
15
|
+
|
16
|
+
def view_context
|
17
|
+
@view_context ||= begin
|
18
|
+
require Rails.root.join('app/controllers/people_controller')
|
19
|
+
|
20
|
+
controller = PeopleController.new
|
21
|
+
controller.set_request!(ActionDispatch::Request.empty)
|
22
|
+
controller.request.session = ActionController::TestSession.new
|
23
|
+
|
24
|
+
if controller.lookup_context.respond_to? :append_view_paths
|
25
|
+
controller.lookup_context.append_view_paths([Rails.root.join('app/views')])
|
26
|
+
else
|
27
|
+
controller.lookup_context.view_paths << Rails.root.join('app/views')
|
28
|
+
end
|
29
|
+
controller.instance_variable_set :@people, []
|
30
|
+
controller.instance_variable_set :@person, Person.new(1, 'Person 1')
|
31
|
+
|
32
|
+
controller.view_context
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def assert_html_content_with_erb_version(view, html)
|
37
|
+
view_context.lookup_context.handlers = [:erb]
|
38
|
+
erb_html = view_context.render(template: "people/#{view}")
|
39
|
+
|
40
|
+
assert_equal scrub(erb_html), scrub(html), "#{view} template result differs from the ERB version"
|
41
|
+
end
|
42
|
+
|
43
|
+
def scrub(html)
|
44
|
+
html = strip_whitespace html
|
45
|
+
strip_authenticity_token! html
|
46
|
+
html
|
47
|
+
end
|
48
|
+
|
49
|
+
def strip_whitespace(html)
|
50
|
+
html_doc = Nokogiri::HTML(html)
|
51
|
+
html_doc.xpath('//text()').each do |text_node|
|
52
|
+
text_node.remove if text_node.text.strip.empty?
|
53
|
+
text_node.content = text_node.text.strip
|
54
|
+
end
|
55
|
+
html_doc.to_html
|
56
|
+
end
|
57
|
+
|
58
|
+
def strip_authenticity_token!(html)
|
59
|
+
html.sub!(/(<input type="hidden" name="authenticity_token" value=").*?"/, '\1"')
|
60
|
+
html.sub!(/(<input autocomplete="off" name="authenticity_token" type="hidden" value=").*?"/, '\1"')
|
61
|
+
end
|
62
|
+
|
63
|
+
test 'should generate a set of templates that are 100% compatible with the original ERB templates' do
|
64
|
+
run_generator
|
65
|
+
run_generator default_arguments + %w(--template-engine haml)
|
66
|
+
|
67
|
+
%w(index edit new show).each do |view|
|
68
|
+
assert_file "app/views/people/#{view}.html.haml"
|
69
|
+
|
70
|
+
view_context.lookup_context.handlers = [:haml]
|
71
|
+
haml_html = view_context.render(template: "people/#{view}")
|
72
|
+
|
73
|
+
assert_html_content_with_erb_version view, haml_html
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -1,26 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rubygems'
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'logger'
|
2
6
|
require 'minitest/autorun'
|
3
7
|
require 'action_pack'
|
4
8
|
require 'action_controller'
|
5
9
|
require 'action_view'
|
10
|
+
require 'active_model'
|
6
11
|
require 'rails'
|
7
12
|
require 'rails/generators'
|
8
13
|
require 'rails/generators/test_case'
|
9
14
|
Bundler.require(:default)
|
10
15
|
|
11
16
|
class TestApp < Rails::Application
|
12
|
-
config.root = File.dirname(__FILE__)
|
17
|
+
config.root = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp', 'rails')))
|
13
18
|
config.eager_load = false
|
14
19
|
end
|
15
20
|
|
16
|
-
|
17
|
-
|
18
|
-
@root ||= Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp', 'rails')))
|
19
|
-
end
|
20
|
-
end
|
21
|
+
require 'action_controller/railtie'
|
22
|
+
require 'action_view/railtie'
|
21
23
|
|
22
24
|
TestApp.initialize!
|
23
25
|
|
26
|
+
Rails.application.routes.draw do
|
27
|
+
resources :people
|
28
|
+
end
|
29
|
+
|
24
30
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
25
31
|
|
26
32
|
module Haml
|
@@ -40,8 +46,25 @@ end
|
|
40
46
|
|
41
47
|
::Rails::Generators::TestCase.include Haml::Rails::GeneratorTestHelpers
|
42
48
|
|
49
|
+
class Person
|
50
|
+
include ActiveModel::Model
|
51
|
+
|
52
|
+
attr_accessor :id, :name
|
53
|
+
|
54
|
+
def initialize(id, name)
|
55
|
+
@id, @name = id, name
|
56
|
+
end
|
57
|
+
|
58
|
+
def to_param
|
59
|
+
{id: @id}
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
class ApplicationController < ActionController::Base
|
64
|
+
end
|
65
|
+
|
43
66
|
# Remove tmp directory when test suite is completed
|
44
|
-
|
67
|
+
Minitest.after_run do
|
45
68
|
tmp_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'tmp'))
|
46
69
|
FileUtils.rm_r(tmp_dir)
|
47
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- André Arko
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: haml
|
@@ -122,24 +121,10 @@ dependencies:
|
|
122
121
|
- - ">="
|
123
122
|
- !ruby/object:Gem::Version
|
124
123
|
version: '0'
|
125
|
-
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
|
-
description: Haml-rails provides Haml generators for Rails 5. It also enables Haml
|
140
|
-
as the templating engine for you, so you don't have to screw around in your own
|
141
|
-
application.rb when your Gemfile already clearly indicated what templating engine
|
142
|
-
you have installed. Hurrah.
|
124
|
+
description: Haml-rails provides Haml generators for Rails 5.1 and above. It also
|
125
|
+
enables Haml as the templating engine for you, so you don't have to screw around
|
126
|
+
in your own application.rb when your Gemfile already clearly indicated what templating
|
127
|
+
engine you have installed. Hurrah.
|
143
128
|
email:
|
144
129
|
- andre@arko.net
|
145
130
|
executables: []
|
@@ -148,16 +133,10 @@ extra_rdoc_files: []
|
|
148
133
|
files:
|
149
134
|
- ".github/workflows/ruby.yml"
|
150
135
|
- ".gitignore"
|
151
|
-
- Appraisals
|
152
136
|
- Gemfile
|
153
137
|
- LICENSE
|
154
138
|
- README.md
|
155
139
|
- Rakefile
|
156
|
-
- gemfiles/rails_5_1.gemfile
|
157
|
-
- gemfiles/rails_5_2.gemfile
|
158
|
-
- gemfiles/rails_6_0.gemfile
|
159
|
-
- gemfiles/rails_6_1.gemfile
|
160
|
-
- gemfiles/rails_7_0.gemfile
|
161
140
|
- haml-rails.gemspec
|
162
141
|
- lib/generators/haml/controller/controller_generator.rb
|
163
142
|
- lib/generators/haml/controller/templates/view.html.haml
|
@@ -167,10 +146,45 @@ files:
|
|
167
146
|
- lib/generators/haml/mailer/templates/view.html.haml
|
168
147
|
- lib/generators/haml/mailer/templates/view.text.haml
|
169
148
|
- lib/generators/haml/scaffold/scaffold_generator.rb
|
149
|
+
- lib/generators/haml/scaffold/templates/5_1/_form.html.haml
|
150
|
+
- lib/generators/haml/scaffold/templates/5_1/edit.html.haml
|
151
|
+
- lib/generators/haml/scaffold/templates/5_1/index.html.haml
|
152
|
+
- lib/generators/haml/scaffold/templates/5_1/new.html.haml
|
153
|
+
- lib/generators/haml/scaffold/templates/5_1/show.html.haml
|
154
|
+
- lib/generators/haml/scaffold/templates/5_2/_form.html.haml
|
155
|
+
- lib/generators/haml/scaffold/templates/5_2/edit.html.haml
|
156
|
+
- lib/generators/haml/scaffold/templates/5_2/index.html.haml
|
157
|
+
- lib/generators/haml/scaffold/templates/5_2/new.html.haml
|
158
|
+
- lib/generators/haml/scaffold/templates/5_2/show.html.haml
|
159
|
+
- lib/generators/haml/scaffold/templates/6_0/_form.html.haml
|
160
|
+
- lib/generators/haml/scaffold/templates/6_0/edit.html.haml
|
161
|
+
- lib/generators/haml/scaffold/templates/6_0/index.html.haml
|
162
|
+
- lib/generators/haml/scaffold/templates/6_0/new.html.haml
|
163
|
+
- lib/generators/haml/scaffold/templates/6_0/show.html.haml
|
164
|
+
- lib/generators/haml/scaffold/templates/6_1/_form.html.haml
|
165
|
+
- lib/generators/haml/scaffold/templates/6_1/edit.html.haml
|
166
|
+
- lib/generators/haml/scaffold/templates/6_1/index.html.haml
|
167
|
+
- lib/generators/haml/scaffold/templates/6_1/new.html.haml
|
168
|
+
- lib/generators/haml/scaffold/templates/6_1/show.html.haml
|
169
|
+
- lib/generators/haml/scaffold/templates/7_0/_form.html.haml
|
170
|
+
- lib/generators/haml/scaffold/templates/7_0/edit.html.haml
|
171
|
+
- lib/generators/haml/scaffold/templates/7_0/index.html.haml
|
172
|
+
- lib/generators/haml/scaffold/templates/7_0/new.html.haml
|
173
|
+
- lib/generators/haml/scaffold/templates/7_0/partial.html.haml
|
174
|
+
- lib/generators/haml/scaffold/templates/7_0/show.html.haml
|
175
|
+
- lib/generators/haml/scaffold/templates/7_1
|
176
|
+
- lib/generators/haml/scaffold/templates/7_2/_form.html.haml
|
177
|
+
- lib/generators/haml/scaffold/templates/7_2/edit.html.haml
|
178
|
+
- lib/generators/haml/scaffold/templates/7_2/index.html.haml
|
179
|
+
- lib/generators/haml/scaffold/templates/7_2/new.html.haml
|
180
|
+
- lib/generators/haml/scaffold/templates/7_2/partial.html.haml
|
181
|
+
- lib/generators/haml/scaffold/templates/7_2/show.html.haml
|
182
|
+
- lib/generators/haml/scaffold/templates/8_0
|
170
183
|
- lib/generators/haml/scaffold/templates/_form.html.haml
|
171
184
|
- lib/generators/haml/scaffold/templates/edit.html.haml
|
172
185
|
- lib/generators/haml/scaffold/templates/index.html.haml
|
173
186
|
- lib/generators/haml/scaffold/templates/new.html.haml
|
187
|
+
- lib/generators/haml/scaffold/templates/partial.html.haml
|
174
188
|
- lib/generators/haml/scaffold/templates/show.html.haml
|
175
189
|
- lib/haml-rails.rb
|
176
190
|
- lib/haml-rails/version.rb
|
@@ -180,12 +194,13 @@ files:
|
|
180
194
|
- test/lib/generators/haml/controller_generator_test.rb
|
181
195
|
- test/lib/generators/haml/mailer_generator_test.rb
|
182
196
|
- test/lib/generators/haml/scaffold_generator_test.rb
|
197
|
+
- test/lib/generators/haml/scaffold_template_contents_test.rb
|
183
198
|
- test/test_helper.rb
|
184
199
|
homepage: https://github.com/haml/haml-rails
|
185
200
|
licenses:
|
186
201
|
- MIT
|
187
|
-
metadata:
|
188
|
-
|
202
|
+
metadata:
|
203
|
+
rubygems_mfa_required: 'true'
|
189
204
|
rdoc_options: []
|
190
205
|
require_paths:
|
191
206
|
- lib
|
@@ -200,8 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
215
|
- !ruby/object:Gem::Version
|
201
216
|
version: 2.0.0
|
202
217
|
requirements: []
|
203
|
-
rubygems_version: 3.
|
204
|
-
signing_key:
|
218
|
+
rubygems_version: 3.8.0.dev
|
205
219
|
specification_version: 4
|
206
220
|
summary: let your Gemfile do the configuring
|
207
221
|
test_files: []
|
data/Appraisals
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
appraise "rails_5_1" do
|
2
|
-
gem "rails", "~> 5.1.0"
|
3
|
-
end
|
4
|
-
|
5
|
-
appraise "rails_5_2" do
|
6
|
-
gem "rails", "~> 5.2.0"
|
7
|
-
end
|
8
|
-
|
9
|
-
appraise "rails_6_0" do
|
10
|
-
gem "rails", "~> 6.0.0"
|
11
|
-
end
|
12
|
-
|
13
|
-
appraise "rails_6_1" do
|
14
|
-
gem "rails", "~> 6.1.0"
|
15
|
-
end
|
16
|
-
|
17
|
-
appraise "rails_7_0" do
|
18
|
-
gem "rails", "~> 7.0.0"
|
19
|
-
end
|
data/gemfiles/rails_5_1.gemfile
DELETED
data/gemfiles/rails_5_2.gemfile
DELETED
data/gemfiles/rails_6_0.gemfile
DELETED
data/gemfiles/rails_6_1.gemfile
DELETED
data/gemfiles/rails_7_0.gemfile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
= form_for @<%= singular_table_name %> do |f|
|
2
|
-
- if @<%= singular_table_name %>.errors.any?
|
3
|
-
#error_explanation
|
4
|
-
%h2= "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:"
|
5
|
-
%ul
|
6
|
-
- @<%= singular_table_name %>.errors.full_messages.each do |message|
|
7
|
-
%li= message
|
8
|
-
|
9
|
-
<% for attribute in attributes -%>
|
10
|
-
.field
|
11
|
-
= f.label :<%= attribute.name %>
|
12
|
-
= f.<%= attribute.field_type %> :<%= attribute.name %>
|
13
|
-
<% end -%>
|
14
|
-
.actions
|
15
|
-
= f.submit 'Save'
|
@@ -1,25 +0,0 @@
|
|
1
|
-
%h1 Listing <%= plural_table_name %>
|
2
|
-
|
3
|
-
%table
|
4
|
-
%thead
|
5
|
-
%tr
|
6
|
-
<% for attribute in attributes -%>
|
7
|
-
%th <%= attribute.human_name %>
|
8
|
-
<% end -%>
|
9
|
-
%th
|
10
|
-
%th
|
11
|
-
%th
|
12
|
-
|
13
|
-
%tbody
|
14
|
-
- @<%= plural_table_name %>.each do |<%= singular_table_name %>|
|
15
|
-
%tr
|
16
|
-
<% for attribute in attributes -%>
|
17
|
-
%td= <%= singular_table_name %>.<%= attribute.name %>
|
18
|
-
<% end -%>
|
19
|
-
%td= link_to 'Show', <%= singular_table_name %>
|
20
|
-
%td= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
|
21
|
-
%td= link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }
|
22
|
-
|
23
|
-
%br
|
24
|
-
|
25
|
-
= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path
|