inline_forms 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.4
1
+ 0.6.5
@@ -10,7 +10,7 @@
10
10
  </head>
11
11
  <%#= calendar_date_select_includes "red" %>
12
12
  <body>
13
- <h1><%= @Klass.to_s %></h1>
13
+ <%= render "/inline_forms_tabs" %>
14
14
  <ul id="inline_form_list">
15
15
  <%= yield %>
16
16
  </ul>
data/inline_forms.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{inline_forms}
8
- s.version = "0.6.4"
8
+ s.version = "0.6.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ace Suares"]
@@ -47,6 +47,7 @@ Gem::Specification.new do |s|
47
47
  "inline_forms.gemspec",
48
48
  "lib/generators/inline_forms/USAGE",
49
49
  "lib/generators/inline_forms/inline_forms_generator.rb",
50
+ "lib/generators/inline_forms/templates/_inline_forms_tabs.html.erb",
50
51
  "lib/generators/inline_forms/templates/controller.erb",
51
52
  "lib/generators/inline_forms/templates/migration.erb",
52
53
  "lib/generators/inline_forms/templates/model.erb",
@@ -65,6 +65,13 @@ module InlineForms
65
65
  template "migration.erb", "db/migrate/#{time_stamp}_inline_forms_create_#{table_name}.rb"
66
66
  end
67
67
 
68
+ def add_tab
69
+ copy_file "_inline_forms_tabs.html.erb", "app/views/_inline_forms_tabs.html.erb" unless File.exists?('app/views/_inline_forms_tabs.html.erb')
70
+ inject_into_file "app/views/_inline_forms_tabs.html.erb",
71
+ " <%= tab.#{name.underscore} '#{name}', #{name.pluralize.underscore + '_path'} %>\n",
72
+ :after => "<% tabs_tag :open_tabs => { :id => \"tabs\" } do |tab| %>\n"
73
+ end
74
+
68
75
  private
69
76
  def model_file_name
70
77
  name.underscore
@@ -0,0 +1,3 @@
1
+ <% tabs_tag :open_tabs => { :id => "tabs" } do |tab| %>
2
+ <% end %>
3
+
@@ -1,2 +1,3 @@
1
- class <%= controller_name %> < InlineFormsController
1
+ class <%= controller_name -%> < InlineFormsController
2
+ set_tab :<%= name.underscore %>
2
3
  end
@@ -76,3 +76,19 @@ h1 { border: 1px solid blue;
76
76
 
77
77
  #inline_form_list div.associated_new {
78
78
  }
79
+
80
+ #tabs {
81
+ border-bottom: 2px solid darkcyan;
82
+ }
83
+
84
+ #tabs li {
85
+ display: inline-block;
86
+ border-left: 2px solid darkcyan;
87
+ padding: 0.2em;
88
+ margin: 0.1em;
89
+ }
90
+
91
+ #tabs .current {
92
+ font-weight: bold;
93
+ border: 2px solid red;
94
+ }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 4
10
- version: 0.6.4
9
+ - 5
10
+ version: 0.6.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ace Suares
@@ -118,6 +118,7 @@ files:
118
118
  - inline_forms.gemspec
119
119
  - lib/generators/inline_forms/USAGE
120
120
  - lib/generators/inline_forms/inline_forms_generator.rb
121
+ - lib/generators/inline_forms/templates/_inline_forms_tabs.html.erb
121
122
  - lib/generators/inline_forms/templates/controller.erb
122
123
  - lib/generators/inline_forms/templates/migration.erb
123
124
  - lib/generators/inline_forms/templates/model.erb