effective_developer 0.2 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0bc78241a7312115a37e3ea85a1e91fe356fdc5
4
- data.tar.gz: e15e7239d99c756268644a9a897388c37319f956
3
+ metadata.gz: a98431485d3aaaaa800ff0ce881b3846fbc154f6
4
+ data.tar.gz: c7fd087d4e38a3859c85f92099fdb7210f7af038
5
5
  SHA512:
6
- metadata.gz: f19e58ab88d396f8a03e6e05fedcf93b994ab1969f3a0cedfc17949edf1ac77fef4af3309d1e78ac1eae7c66ec3817b6847e709c0404744ad3ee7287664ead0e
7
- data.tar.gz: c546bacc1dd23d075566de969a10246cfddaa0f618b25c8a01ad2b1271035b2053d2344094064010b4fd1badb19448c51534cad970975ec5fb274590549ef1c4
6
+ metadata.gz: 2150d74a7c45702968db18947d68b5d6a7eceed6c2fbae6f8801fcbc6b96afcfede8ce052bf7882f85e8d43468ff3762deed4dea09e5f320cf9904e8644c952a
7
+ data.tar.gz: d5f63dded7cf53a851dd397bbdd56250dc0b30c61eeaa1bc6094bf3605fc5ce628944ca472d76e4a30c7ab9859315bd3b35a6a1b7d2167ed7e4cf0feb0129a78
data/README.md CHANGED
@@ -270,11 +270,11 @@ class Post < ApplicationRecord
270
270
  belongs_to :category
271
271
 
272
272
  # Attributes
273
- # name :string
273
+ # title :string
274
274
  # body :text
275
275
  # published_at :datetime
276
276
 
277
- validates :name, presence: true
277
+ validates :title, presence: true
278
278
  validates :description, presence: true
279
279
 
280
280
  has_many :comments
@@ -283,16 +283,15 @@ class Post < ApplicationRecord
283
283
  scope :published, -> { where.not(published_at: nil) }
284
284
 
285
285
  def to_s
286
- name || 'New Post'
286
+ title || 'New Post'
287
287
  end
288
288
  end
289
289
  ```
290
290
 
291
- and then run
292
-
291
+ and then run`
293
292
  ```console
294
- rails generate scaffold post
295
- rails generate scaffold_controller admin/post
293
+ rails generate effective:scaffold post
294
+ rails generate effective:scaffold_controller admin/post
296
295
  ```
297
296
 
298
297
  Tweak from here
@@ -1,3 +1,3 @@
1
1
  module EffectiveDeveloper
2
- VERSION = '0.2'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
@@ -43,7 +43,7 @@ module Effective
43
43
  resource.nested_resources.each do |_, nested_resource|
44
44
  @nested_resource = nested_resource
45
45
  template 'forms/tabpanel/_tab_nested_resource.html.haml', resource.view_file("form_#{nested_resource.plural_name}", partial: true)
46
- template 'forms/fields/_nested_resource_fields.html.haml', File.join('app/views', resource.namespace, (resource.namespace.present? ? '' : resource.class_path), nested_resource.name.to_s.underscore.pluralize, '_fields.html.haml')
46
+ template 'forms/fields/_nested_resource_fields.html.haml', File.join('app/views', resource.namespace.to_s, (resource.namespace.present? ? '' : resource.class_path), nested_resource.name.to_s.underscore.pluralize, '_fields.html.haml')
47
47
  end
48
48
  end
49
49
 
@@ -5,11 +5,12 @@
5
5
  <% attributes.each do |attribute| -%>
6
6
  <%= render_field(attribute, depth: 1) %>
7
7
  <% end -%>
8
- <% if defined?(EffectiveResources) -%>
8
+
9
+ .form-actions
10
+ <% if defined?(EffectiveResources) -%>
9
11
  = simple_form_submit(f)
10
- <% else -%>
11
- %p.text-right
12
- = f.button :submit, 'Save', data: { disable_with: 'Saving...' }
13
- = f.button :submit, 'Save and Continue', data: { disable_with: 'Saving...' }
14
- = f.button :submit, 'Save and Add New', data: { disable_with: 'Saving...' }
15
- <% end -%>
12
+ <% else -%>
13
+ f.button :submit, 'Save', data: { disable_with: 'Saving...' }
14
+ f.button :submit, 'Save and Continue', data: { disable_with: 'Saving...' }
15
+ f.button :submit, 'Save and Add New', data: { disable_with: 'Saving...' }
16
+ <% end -%>
@@ -1,4 +1 @@
1
- = f.input :<%= reference.foreign_key.presence || (reference.name.to_s + '_id') %>,
2
- as: :effective_select, collection: <%= reference.name.to_s.classify %>.all,
3
- hint: ''
4
-
1
+ = f.input :<%= reference.foreign_key.presence || (reference.name.to_s + '_id') %>, as: :effective_select, collection: <%= reference.name.to_s.classify %>.all
@@ -1,2 +1 @@
1
- = f.input :<%= attribute.name %>, as: :boolean,
2
- hint: ''
1
+ = f.input :<%= attribute.name %>, as: :boolean
@@ -1,2 +1 @@
1
- = f.input :<%= attribute.name %>, as: :effective_date_picker,
2
- hint: ''
1
+ = f.input :<%= attribute.name %>, as: :effective_date_picker
@@ -1,2 +1 @@
1
- = f.input :<%= attribute.name %>, as: :effective_date_time_picker,
2
- hint: ''
1
+ = f.input :<%= attribute.name %>, as: :effective_date_time_picker
@@ -1,2 +1 @@
1
- = f.input :<%= attribute.name %>,
2
- hint: ''
1
+ = f.input :<%= attribute.name %>
@@ -1,2 +1 @@
1
- = f.input :<%= attribute.name %>,
2
- hint: ''
1
+ = f.input :<%= attribute.name %>
@@ -1,2 +1 @@
1
- = f.input :<%= attribute.name %>,
2
- hint: ''
1
+ = f.input :<%= attribute.name %>
@@ -1,2 +1 @@
1
- = f.input :<%= attribute.name %>, as: :text,
2
- hint: ''
1
+ = f.input :<%= attribute.name %>, as: :text
@@ -18,15 +18,13 @@
18
18
  <% resource.nested_resources.each do |_, nested_resource| -%>
19
19
  #<%= nested_resource.plural_name %>-tab.tab-pane{role: 'tabpanel'}
20
20
  = render 'form_<%= nested_resource.plural_name %>', f: f
21
-
22
21
  <% end -%>
23
- %hr
24
22
 
25
- <% if defined?(EffectiveResources) -%>
23
+ .form-actions
24
+ <% if defined?(EffectiveResources) -%>
26
25
  = simple_form_submit(f)
27
- <% else -%>
28
- %p.text-right
29
- = f.button :submit, 'Save', data: { disable_with: 'Saving...' }
30
- = f.button :submit, 'Save and Continue', data: { disable_with: 'Saving...' }
31
- = f.button :submit, 'Save and Add New', data: { disable_with: 'Saving...' }
32
- <% end -%>
26
+ <% else -%>
27
+ = f.button :submit, 'Save', data: { disable_with: 'Saving...' }
28
+ = f.button :submit, 'Save and Continue', data: { disable_with: 'Saving...' }
29
+ = f.button :submit, 'Save and Add New', data: { disable_with: 'Saving...' }
30
+ <% end -%>
@@ -4,9 +4,9 @@
4
4
  %tr
5
5
  %th <%= reference.name.to_s.titleize %>
6
6
  %td= <%= resource.name %>.<%= reference.name %>
7
- <% end %>
7
+ <% end -%>
8
8
  <% attributes.each do |attribute| -%>
9
9
  %tr
10
10
  %th <%= attribute.name.titleize %>
11
11
  %td= <%= resource.name %>.<%= attribute.name %>
12
- <% end %>
12
+ <% end -%>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_developer
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect