erb_form 0.1.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.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +1 -0
- data/erb_form.gemspec +21 -0
- data/lib/erb_form/builder.rb +81 -0
- data/lib/erb_form/version.rb +3 -0
- data/lib/erb_form.rb +10 -0
- data/spec/spec_helper.rb +27 -0
- data/spec/support/model.rb +14 -0
- data/spec/test_app/.gitignore +4 -0
- data/spec/test_app/.rspec +1 -0
- data/spec/test_app/Gemfile +11 -0
- data/spec/test_app/Rakefile +7 -0
- data/spec/test_app/app/controllers/application_controller.rb +3 -0
- data/spec/test_app/app/controllers/blogs_controller.rb +11 -0
- data/spec/test_app/app/models/blog.rb +3 -0
- data/spec/test_app/app/views/blogs/double_render_error.html.erb +5 -0
- data/spec/test_app/app/views/blogs/double_render_field.html.erb +3 -0
- data/spec/test_app/app/views/blogs/find_defaults.html.erb +5 -0
- data/spec/test_app/app/views/blogs/find_layouts.html.erb +5 -0
- data/spec/test_app/app/views/blogs/legacy_field.html.erb +3 -0
- data/spec/test_app/app/views/blogs/missing_attribute_template_error.html.erb +5 -0
- data/spec/test_app/app/views/blogs/missing_layout_template_error.html.erb +5 -0
- data/spec/test_app/app/views/blogs/name_field.html.erb +3 -0
- data/spec/test_app/app/views/forms/default/field.html.erb +3 -0
- data/spec/test_app/app/views/forms/default/legacy_field.html.erb +3 -0
- data/spec/test_app/app/views/forms/default/name_field.html.erb +3 -0
- data/spec/test_app/app/views/forms/legacy/field.html.erb +3 -0
- data/spec/test_app/app/views/forms/legacy/name_field.html.erb +3 -0
- data/spec/test_app/config/application.rb +42 -0
- data/spec/test_app/config/boot.rb +6 -0
- data/spec/test_app/config/database.yml +14 -0
- data/spec/test_app/config/environment.rb +5 -0
- data/spec/test_app/config/environments/development.rb +26 -0
- data/spec/test_app/config/environments/test.rb +35 -0
- data/spec/test_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/test_app/config/initializers/inflections.rb +10 -0
- data/spec/test_app/config/initializers/mime_types.rb +5 -0
- data/spec/test_app/config/initializers/secret_token.rb +7 -0
- data/spec/test_app/config/initializers/session_store.rb +8 -0
- data/spec/test_app/config/initializers/simple_form.rb +133 -0
- data/spec/test_app/config/locales/simple_form.en.yml +1 -0
- data/spec/test_app/config/routes.rb +4 -0
- data/spec/test_app/config.ru +4 -0
- data/spec/test_app/db/migrate/20110629092717_create_blogs.rb +16 -0
- data/spec/test_app/db/schema.rb +24 -0
- data/spec/test_app/db/seeds.rb +7 -0
- data/spec/test_app/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/spec/test_app/script/rails +6 -0
- data/spec/test_app/spec/spec_helper.rb +27 -0
- data/spec/test_app/spec/views/blogs/double_render_error.html.erb_spec.rb +16 -0
- data/spec/test_app/spec/views/blogs/find_defaults.html.erb_spec.rb +44 -0
- data/spec/test_app/spec/views/blogs/find_layouts.html.erb_spec.rb +82 -0
- data/spec/test_app/spec/views/blogs/missing_attribute_template_error.html.erb_spec.rb +28 -0
- data/spec/test_app/spec/views/blogs/missing_layout_template_error.html.erb_spec.rb +28 -0
- metadata +159 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/erb_form.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "erb_form/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "erb_form"
|
7
|
+
s.version = ErbForm::VERSION
|
8
|
+
s.authors = ["Benjamin Lewis"]
|
9
|
+
s.email = ["23inhouse@gmail.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{ERB templated forms}
|
12
|
+
s.description = %q{Wrap form helper methods in re-usable erb templates.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "erb_form"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
s.add_dependency('simple_form', '>=2.0.0.rc')
|
21
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
module ErbForm
|
2
|
+
class Builder < ::SimpleForm::FormBuilder
|
3
|
+
def field(attribute_name, options = {})
|
4
|
+
raise ErbForm::DoubleRenderError.new(clean_backtrace(caller)), nil, clean_backtrace(caller) if recursing?
|
5
|
+
@prevent_recursion = true
|
6
|
+
@field_layout = options.delete(:layout)
|
7
|
+
return render_field(field_template_path(attribute_name), attribute_name, options)
|
8
|
+
rescue ActionView::MissingTemplate => e
|
9
|
+
raise ErbForm::MissingTemplate.new(field_layouts(attribute_name)), nil, clean_backtrace(e.backtrace)
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def recursing?
|
15
|
+
!!@prevent_recursion
|
16
|
+
end
|
17
|
+
|
18
|
+
def field_layouts(attribute_name)
|
19
|
+
file = @field_layout.nil? ? attribute_name.to_s : @field_layout
|
20
|
+
[
|
21
|
+
[ErbForm.forms_path, @field_layout, attribute_name.to_s+'_field'], # forms/custom_layout/attribute_name_field.html.erb
|
22
|
+
[template.controller_path, file+'_field'], # resourse_path/attribute_name_field.html.erb
|
23
|
+
[ErbForm.forms_path, @field_layout, 'field'], # forms/custom_layout/field.html.erb
|
24
|
+
[ErbForm.forms_path, 'default', file+'_field'], # forms/attribute_name_field.html.erb
|
25
|
+
[ErbForm.forms_path, 'default', 'field'] # forms/attribute_name/field.html.erb
|
26
|
+
].delete_if { |template_array|
|
27
|
+
template_array.include? nil
|
28
|
+
}.map { |template_array|
|
29
|
+
template_array.join('/')
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
def render_field(field_template_path, attribute_name, options)
|
34
|
+
output = template.render(:file => '/' + (field_template_path || 'a_non_existant_file_to_force_a_missing_template_error'), :locals => {
|
35
|
+
:form => self,
|
36
|
+
:attribute_name => attribute_name,
|
37
|
+
:options => options
|
38
|
+
})
|
39
|
+
@prevent_recursion = false
|
40
|
+
output
|
41
|
+
end
|
42
|
+
|
43
|
+
def field_template_path(attribute_name)
|
44
|
+
@field_template_path ||= field_layouts(attribute_name).detect { |template_file|
|
45
|
+
template.view_paths.exists?(template_file, '', false, {
|
46
|
+
:locale => [template.locale],
|
47
|
+
:formats => template.formats,
|
48
|
+
:handlers => [:erb, :rjs, :builder, :rhtml, :rxml]
|
49
|
+
})
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
def clean_backtrace(backtrace)
|
54
|
+
unless backtrace[0].scan(__FILE__).size > 0
|
55
|
+
backtrace = backtrace.collect { |line| line.scan(__FILE__).size > 0 ? nil : line }.compact!
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
class DoubleRenderError < StandardError;
|
61
|
+
def initialize(caller)
|
62
|
+
@caller = caller
|
63
|
+
end
|
64
|
+
|
65
|
+
def message
|
66
|
+
%(Called `field' from #{@caller.first})
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
class MissingTemplate < StandardError;
|
71
|
+
def initialize(failed_templates)
|
72
|
+
@failed_templates = failed_templates
|
73
|
+
end
|
74
|
+
|
75
|
+
def message
|
76
|
+
%(Missing Template, tried:\n - #{@failed_templates.join("\n - ")})
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
ActionView::Base.default_form_builder = ErbForm::Builder
|
data/lib/erb_form.rb
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../test_app/config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
|
6
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
7
|
+
# in spec/support/ and its subdirectories.
|
8
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
9
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
10
|
+
RSpec.configure do |config|
|
11
|
+
# == Mock Framework
|
12
|
+
#
|
13
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
14
|
+
#
|
15
|
+
# config.mock_with :mocha
|
16
|
+
# config.mock_with :flexmock
|
17
|
+
# config.mock_with :rr
|
18
|
+
config.mock_with :rspec
|
19
|
+
|
20
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
21
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
22
|
+
|
23
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
24
|
+
# examples within a transaction, remove the following line or assign false
|
25
|
+
# instead of true.
|
26
|
+
config.use_transactional_fixtures = true
|
27
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require File.expand_path('../config/application', __FILE__)
|
5
|
+
require 'rake'
|
6
|
+
|
7
|
+
TestApp::Application.load_tasks
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# If you have a Gemfile, require the gems listed there, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
8
|
+
|
9
|
+
module TestApp
|
10
|
+
class Application < Rails::Application
|
11
|
+
# Settings in config/environments/* take precedence over those specified here.
|
12
|
+
# Application configuration should go into files in config/initializers
|
13
|
+
# -- all .rb files in that directory are automatically loaded.
|
14
|
+
|
15
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
16
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
17
|
+
|
18
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
19
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
20
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
21
|
+
|
22
|
+
# Activate observers that should always be running.
|
23
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
24
|
+
|
25
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
26
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
27
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
28
|
+
|
29
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
|
+
# config.i18n.default_locale = :de
|
32
|
+
|
33
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
34
|
+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
35
|
+
|
36
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
37
|
+
config.encoding = "utf-8"
|
38
|
+
|
39
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
40
|
+
config.filter_parameters += [:password]
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
development:
|
2
|
+
adapter: sqlite3
|
3
|
+
database: db/test.sqlite3
|
4
|
+
pool: 5
|
5
|
+
timeout: 5000
|
6
|
+
|
7
|
+
# Warning: The database defined as "test" will be erased and
|
8
|
+
# re-generated from your development database when you run "rake".
|
9
|
+
# Do not set this db to the same as development or production.
|
10
|
+
test:
|
11
|
+
adapter: sqlite3
|
12
|
+
database: db/test.sqlite3
|
13
|
+
pool: 5
|
14
|
+
timeout: 5000
|
@@ -0,0 +1,26 @@
|
|
1
|
+
TestApp::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the webserver when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
|
20
|
+
# Print deprecation notices to the Rails logger
|
21
|
+
config.active_support.deprecation = :log
|
22
|
+
|
23
|
+
# Only use best-standards-support built into browsers
|
24
|
+
config.action_dispatch.best_standards_support = :builtin
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
TestApp::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
11
|
+
config.whiny_nils = true
|
12
|
+
|
13
|
+
# Show full error reports and disable caching
|
14
|
+
config.consider_all_requests_local = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
18
|
+
config.action_dispatch.show_exceptions = false
|
19
|
+
|
20
|
+
# Disable request forgery protection in test environment
|
21
|
+
config.action_controller.allow_forgery_protection = false
|
22
|
+
|
23
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
24
|
+
# The :test delivery method accumulates sent emails in the
|
25
|
+
# ActionMailer::Base.deliveries array.
|
26
|
+
config.action_mailer.delivery_method = :test
|
27
|
+
|
28
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
29
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
30
|
+
# like if you have constraints or database-specific column types
|
31
|
+
# config.active_record.schema_format = :sql
|
32
|
+
|
33
|
+
# Print deprecation notices to the stderr
|
34
|
+
config.active_support.deprecation = :stderr
|
35
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
TestApp::Application.config.secret_token = 'bae5cac3b487872012d63f4b6c3e3708e051d0730b57c43b9d91b395c78c0c46bffcfc0f4f7fa944df5361edb8c5e9c8c8b6c7a1a7d3400fc7c9eaab8bf6094f'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
TestApp::Application.config.session_store :cookie_store, :key => '_test_app_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rails generate session_migration")
|
8
|
+
# TestApp::Application.config.session_store :active_record_store
|
@@ -0,0 +1,133 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
# Wrappers are used by the form builder to generate a
|
4
|
+
# complete input. You can remove any component from the
|
5
|
+
# wrapper, change the order or even add your own to the
|
6
|
+
# stack. The options given below are used to wrap the
|
7
|
+
# whole input.
|
8
|
+
config.wrappers :default, :class => :input,
|
9
|
+
:hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
|
10
|
+
## Extensions enabled by default
|
11
|
+
# Any of these extensions can be disabled for a
|
12
|
+
# given input by passing: `f.input EXTENSION_NAME => false`.
|
13
|
+
# You can make any of these extensions optional by
|
14
|
+
# renaming `b.use` to `b.optional`.
|
15
|
+
|
16
|
+
# Determines whether to use HTML5 (:email, :url, ...)
|
17
|
+
# and required attributes
|
18
|
+
b.use :html5
|
19
|
+
|
20
|
+
# Calculates placeholders automatically from I18n
|
21
|
+
# You can also pass a string as f.input :placeholder => "Placeholder"
|
22
|
+
b.use :placeholder
|
23
|
+
|
24
|
+
## Optional extensions
|
25
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
|
26
|
+
# to the input. If so, they will retrieve the values from the model
|
27
|
+
# if any exists. If you want to enable the lookup for any of those
|
28
|
+
# extensions by default, you can change `b.optional` to `b.use`.
|
29
|
+
|
30
|
+
# Calculates maxlength from length validations for string inputs
|
31
|
+
b.optional :maxlength
|
32
|
+
|
33
|
+
# Calculates pattern from format validations for string inputs
|
34
|
+
b.optional :pattern
|
35
|
+
|
36
|
+
# Calculates min and max from length validations for numeric inputs
|
37
|
+
b.optional :min_max
|
38
|
+
|
39
|
+
# Calculates readonly automatically from readonly attributes
|
40
|
+
b.optional :readonly
|
41
|
+
|
42
|
+
## Inputs
|
43
|
+
b.use :input
|
44
|
+
# b.use :hint#, :tag => :span, :class => :hint
|
45
|
+
# b.use :error#, :tag => :span, :class => :error
|
46
|
+
end
|
47
|
+
|
48
|
+
# The default wrapper to be used by the FormBuilder.
|
49
|
+
config.default_wrapper = :default
|
50
|
+
|
51
|
+
# Define the way to render check boxes / radio buttons with labels.
|
52
|
+
# Defaults to :nested for bootstrap config.
|
53
|
+
# :inline => input + label
|
54
|
+
# :nested => label > input
|
55
|
+
config.boolean_style = :nested
|
56
|
+
|
57
|
+
# Default class for buttons
|
58
|
+
config.button_class = 'btn'
|
59
|
+
|
60
|
+
# Method used to tidy up errors.
|
61
|
+
# config.error_method = :first
|
62
|
+
|
63
|
+
# Default tag used for error notification helper.
|
64
|
+
# config.error_notification_tag = :p
|
65
|
+
|
66
|
+
# CSS class to add for error notification helper.
|
67
|
+
# config.error_notification_class = :error_notification
|
68
|
+
|
69
|
+
# ID to add for error notification helper.
|
70
|
+
# config.error_notification_id = nil
|
71
|
+
|
72
|
+
# Series of attempts to detect a default label method for collection.
|
73
|
+
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
74
|
+
|
75
|
+
# Series of attempts to detect a default value method for collection.
|
76
|
+
# config.collection_value_methods = [ :id, :to_s ]
|
77
|
+
|
78
|
+
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
79
|
+
# config.collection_wrapper_tag = nil
|
80
|
+
|
81
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
82
|
+
# config.collection_wrapper_class = nil
|
83
|
+
|
84
|
+
# You can wrap each item in a collection of radio/check boxes with a tag,
|
85
|
+
# defaulting to :span. Please note that when using :boolean_style = :nested,
|
86
|
+
# SimpleForm will force this option to be a label.
|
87
|
+
# config.item_wrapper_tag = :span
|
88
|
+
|
89
|
+
# You can define a class to use in all item wrappers. Defaulting to none.
|
90
|
+
# config.item_wrapper_class = nil
|
91
|
+
|
92
|
+
# How the label text should be generated altogether with the required text.
|
93
|
+
# config.label_text = lambda { |label, required| "#{required} #{label}" }
|
94
|
+
|
95
|
+
# You can define the class to use on all labels. Default is nil.
|
96
|
+
# config.label_class = nil
|
97
|
+
|
98
|
+
# You can define the class to use on all forms. Default is simple_form.
|
99
|
+
# config.form_class = :simple_form
|
100
|
+
|
101
|
+
# Whether attributes are required by default (or not). Default is true.
|
102
|
+
# config.required_by_default = true
|
103
|
+
|
104
|
+
# Tell browsers whether to use default HTML5 validations (novalidate option).
|
105
|
+
# Default is enabled.
|
106
|
+
config.browser_validations = false
|
107
|
+
|
108
|
+
# Collection of methods to detect if a file type was given.
|
109
|
+
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
110
|
+
|
111
|
+
# Custom mappings for input types. This should be a hash containing a regexp
|
112
|
+
# to match as key, and the input type that will be used when the field name
|
113
|
+
# matches the regexp as value.
|
114
|
+
# config.input_mappings = { /count/ => :integer }
|
115
|
+
|
116
|
+
# Default priority for time_zone inputs.
|
117
|
+
# config.time_zone_priority = nil
|
118
|
+
|
119
|
+
# Default priority for country inputs.
|
120
|
+
# config.country_priority = nil
|
121
|
+
|
122
|
+
# Default size for text inputs.
|
123
|
+
# config.default_input_size = 50
|
124
|
+
|
125
|
+
# When false, do not use translations for labels.
|
126
|
+
# config.translate_labels = true
|
127
|
+
|
128
|
+
# Automatically discover new inputs in Rails' autoload path.
|
129
|
+
# config.inputs_discovery = true
|
130
|
+
|
131
|
+
# Cache simple form inputs discovery
|
132
|
+
# config.cache_discovery = !Rails.env.development?
|
133
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
en:
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateBlogs < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :blogs do |t|
|
4
|
+
t.string :name
|
5
|
+
t.text :post
|
6
|
+
t.boolean :published
|
7
|
+
t.date :release_date
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :my_erb_form
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your
|
6
|
+
# database schema. If you need to create the application database on another
|
7
|
+
# system, you should be using db:schema:load, not running all the migrations
|
8
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
+
#
|
11
|
+
# It's strongly recommended to check this file into your version control system.
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define(:version => 20110629092717) do
|
14
|
+
|
15
|
+
create_table "blogs", :force => true do |t|
|
16
|
+
t.string "name"
|
17
|
+
t.text "post"
|
18
|
+
t.boolean "published"
|
19
|
+
t.date "release_date"
|
20
|
+
t.datetime "created_at"
|
21
|
+
t.datetime "updated_at"
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
+
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
+
#
|
4
|
+
# Examples:
|
5
|
+
#
|
6
|
+
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
7
|
+
# Mayor.create(:name => 'Daley', :city => cities.first)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
|
2
|
+
<%%= f.error_notification %>
|
3
|
+
|
4
|
+
<div class="inputs">
|
5
|
+
<%- attributes.each do |attribute| -%>
|
6
|
+
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
|
7
|
+
<%- end -%>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="actions">
|
11
|
+
<%%= f.button :submit %>
|
12
|
+
</div>
|
13
|
+
<%% end %>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
4
|
+
require 'rspec/rails'
|
5
|
+
|
6
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
7
|
+
# in spec/support/ and its subdirectories.
|
8
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
# == Mock Framework
|
12
|
+
#
|
13
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
14
|
+
#
|
15
|
+
# config.mock_with :mocha
|
16
|
+
# config.mock_with :flexmock
|
17
|
+
# config.mock_with :rr
|
18
|
+
config.mock_with :rspec
|
19
|
+
|
20
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
21
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
22
|
+
|
23
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
24
|
+
# examples within a transaction, remove the following line or assign false
|
25
|
+
# instead of true.
|
26
|
+
config.use_transactional_fixtures = true
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "blogs/double_render_error" do
|
4
|
+
before(:each) do
|
5
|
+
assign(:blog, stub_model(Blog,
|
6
|
+
:name => "My name",
|
7
|
+
).as_new_record)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "when calling field from within an ErbForm template" do
|
11
|
+
it "raises a double render error" do
|
12
|
+
# lambda { render } .should raise_error(ErbForm::DoubleRenderError, "Called `field' from")
|
13
|
+
lambda { render } .should raise_error(ActionView::Template::Error)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "blogs/find_defaults" do
|
4
|
+
before(:each) do
|
5
|
+
assign(:blog, stub_model(Blog,
|
6
|
+
:name => "My name",
|
7
|
+
).as_new_record)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "when calling field" do
|
11
|
+
describe "with a blogs/name/field layout" do
|
12
|
+
it "renders the layout" do
|
13
|
+
render
|
14
|
+
rendered.should have_selector "div", :class => "blogs_name_field"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "with a forms/default/name_field layout" do
|
19
|
+
before { `mv app/views/blogs/name_field.html.erb app/views/blogs/name_field.html.erb.backup` unless `ls app/views/blogs/name_field.html.erb`.blank? }
|
20
|
+
after { `mv app/views/blogs/name_field.html.erb.backup app/views/blogs/name_field.html.erb` unless `ls app/views/blogs/name_field.html.erb.backup`.blank? }
|
21
|
+
|
22
|
+
it "renders the layout" do
|
23
|
+
render
|
24
|
+
rendered.should have_selector "div", :class => "forms_default_name_field"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "with a forms/default/field layout" do
|
29
|
+
before {
|
30
|
+
`mv app/views/blogs/name_field.html.erb app/views/blogs/name_field.html.erb.backup` unless `ls app/views/blogs/name_field.html.erb`.blank?
|
31
|
+
`mv app/views/forms/default/name_field.html.erb app/views/forms/default/name_field.html.erb.backup` unless `ls app/views/forms/default/name_field.html.erb`.blank?
|
32
|
+
}
|
33
|
+
after {
|
34
|
+
`mv app/views/blogs/name_field.html.erb.backup app/views/blogs/name_field.html.erb` unless `ls app/views/blogs/name_field.html.erb.backup`.blank?
|
35
|
+
`mv app/views/forms/default/name_field.html.erb.backup app/views/forms/default/name_field.html.erb` unless `ls app/views/forms/default/name_field.html.erb.backup`.blank?
|
36
|
+
}
|
37
|
+
|
38
|
+
it "renders the layout" do
|
39
|
+
render
|
40
|
+
rendered.should have_selector "div", :class => "forms_default_field"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "blogs/find_layouts" do
|
4
|
+
before(:each) do
|
5
|
+
assign(:blog, stub_model(Blog,
|
6
|
+
:name => "My name",
|
7
|
+
).as_new_record)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "when calling field with a layout" do
|
11
|
+
describe "and a forms/legacy/name_field layout" do
|
12
|
+
it "renders the layout" do
|
13
|
+
render
|
14
|
+
rendered.should have_selector "div", :class => "forms_legacy_name_field"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "and a blogs/legacy/field layout" do
|
19
|
+
before { `mv app/views/forms/legacy/name_field.html.erb app/views/forms/legacy/name_field.html.erb.backup` unless `ls app/views/forms/legacy/name_field.html.erb`.blank? }
|
20
|
+
after { `mv app/views/forms/legacy/name_field.html.erb.backup app/views/forms/legacy/name_field.html.erb` unless `ls app/views/forms/legacy/name_field.html.erb.backup`.blank? }
|
21
|
+
|
22
|
+
it "renders the layout" do
|
23
|
+
render
|
24
|
+
rendered.should have_selector "div", :class => "blogs_legacy_field"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "and a forms/legacy/field layout" do
|
29
|
+
before {
|
30
|
+
`mv app/views/forms/legacy/name_field.html.erb app/views/forms/legacy/name_field.html.erb.backup` unless `ls app/views/forms/legacy/name_field.html.erb`.blank?
|
31
|
+
`mv app/views/blogs/legacy_field.html.erb app/views/blogs/legacy_field.html.erb.backup` unless `ls app/views/blogs/legacy_field.html.erb`.blank?
|
32
|
+
}
|
33
|
+
after {
|
34
|
+
`mv app/views/forms/legacy/name_field.html.erb.backup app/views/forms/legacy/name_field.html.erb` unless `ls app/views/forms/legacy/name_field.html.erb.backup`.blank?
|
35
|
+
`mv app/views/blogs/legacy_field.html.erb.backup app/views/blogs/legacy_field.html.erb` unless `ls app/views/blogs/legacy_field.html.erb.backup`.blank?
|
36
|
+
}
|
37
|
+
|
38
|
+
it "renders the layout" do
|
39
|
+
render
|
40
|
+
rendered.should have_selector "div", :class => "forms_legacy_field"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "and a forms/default/legacy/field layout" do
|
45
|
+
before {
|
46
|
+
`mv app/views/forms/legacy/name_field.html.erb app/views/forms/legacy/name_field.html.erb.backup` unless `ls app/views/forms/legacy/name_field.html.erb`.blank?
|
47
|
+
`mv app/views/blogs/legacy_field.html.erb app/views/blogs/legacy_field.html.erb.backup` unless `ls app/views/blogs/legacy_field.html.erb`.blank?
|
48
|
+
`mv app/views/forms/legacy/field.html.erb app/views/forms/legacy/field.html.erb.backup` unless `ls app/views/forms/legacy/field.html.erb`.blank?
|
49
|
+
}
|
50
|
+
after {
|
51
|
+
`mv app/views/forms/legacy/name_field.html.erb.backup app/views/forms/legacy/name_field.html.erb` unless `ls app/views/forms/legacy/name_field.html.erb.backup`.blank?
|
52
|
+
`mv app/views/blogs/legacy_field.html.erb.backup app/views/blogs/legacy_field.html.erb` unless `ls app/views/blogs/legacy_field.html.erb.backup`.blank?
|
53
|
+
`mv app/views/forms/legacy/field.html.erb.backup app/views/forms/legacy/field.html.erb` unless `ls app/views/forms/legacy/field.html.erb.backup`.blank?
|
54
|
+
}
|
55
|
+
|
56
|
+
it "renders the layout" do
|
57
|
+
render
|
58
|
+
rendered.should have_selector "div", :class => "forms_default_legacy_field"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe "and a fors/default/field layout" do
|
63
|
+
before {
|
64
|
+
`mv app/views/forms/legacy/name_field.html.erb app/views/forms/legacy/name_field.html.erb.backup` unless `ls app/views/forms/legacy/name_field.html.erb`.blank?
|
65
|
+
`mv app/views/blogs/legacy_field.html.erb app/views/blogs/legacy_field.html.erb.backup` unless `ls app/views/blogs/legacy_field.html.erb`.blank?
|
66
|
+
`mv app/views/forms/legacy/field.html.erb app/views/forms/legacy/field.html.erb.backup` unless `ls app/views/forms/legacy/field.html.erb`.blank?
|
67
|
+
`mv app/views/forms/default/legacy_field.html.erb app/views/forms/default/legacy_field.html.erb.backup` unless `ls app/views/forms/default/legacy_field.html.erb`.blank?
|
68
|
+
}
|
69
|
+
after {
|
70
|
+
`mv app/views/forms/legacy/name_field.html.erb.backup app/views/forms/legacy/name_field.html.erb` unless `ls app/views/forms/legacy/name_field.html.erb.backup`.blank?
|
71
|
+
`mv app/views/blogs/legacy_field.html.erb.backup app/views/blogs/legacy_field.html.erb` unless `ls app/views/blogs/legacy_field.html.erb.backup`.blank?
|
72
|
+
`mv app/views/forms/legacy/field.html.erb.backup app/views/forms/legacy/field.html.erb` unless `ls app/views/forms/legacy/field.html.erb.backup`.blank?
|
73
|
+
`mv app/views/forms/default/legacy_field.html.erb.backup app/views/forms/default/legacy_field.html.erb` unless `ls app/views/forms/default/legacy_field.html.erb.backup`.blank?
|
74
|
+
}
|
75
|
+
|
76
|
+
it "renders the layout" do
|
77
|
+
render
|
78
|
+
rendered.should have_selector "div", :class => "forms_default_field"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "blogs/missing_attribute_template_error" do
|
4
|
+
before(:each) do
|
5
|
+
assign(:blog, stub_model(Blog,
|
6
|
+
:name => "My name",
|
7
|
+
).as_new_record)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "when calling field with a missing attribute" do
|
11
|
+
before do
|
12
|
+
`mv app/views/blogs/name_field.html.erb app/views/blogs/name_field.html.erb.backup` unless `ls app/views/blogs/name_field.html.erb`.blank?
|
13
|
+
`mv app/views/forms/default/name_field.html.erb app/views/forms/default/name_field.html.erb.backup` unless `ls app/views/forms/default/name_field.html.erb`.blank?
|
14
|
+
`mv app/views/forms/default/field.html.erb app/views/forms/default/field.html.erb.backup` unless `ls app/views/forms/default/field.html.erb`.blank?
|
15
|
+
end
|
16
|
+
|
17
|
+
after do
|
18
|
+
`mv app/views/blogs/name_field.html.erb.backup app/views/blogs/name_field.html.erb` unless `ls app/views/blogs/name_field.html.erb.backup`.blank?
|
19
|
+
`mv app/views/forms/default/name_field.html.erb.backup app/views/forms/default/name_field.html.erb` unless `ls app/views/forms/default/name_field.html.erb.backup`.blank?
|
20
|
+
`mv app/views/forms/default/field.html.erb.backup app/views/forms/default/field.html.erb` unless `ls app/views/forms/default/field.html.erb.backup`.blank?
|
21
|
+
end
|
22
|
+
|
23
|
+
it "raises a missing template error" do
|
24
|
+
# lambda { render } .should raise_error(ErbForm::MissingTemplate)
|
25
|
+
lambda { render } .should raise_error(ActionView::Template::Error)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "blogs/missing_layout_template_error" do
|
4
|
+
before(:each) do
|
5
|
+
assign(:blog, stub_model(Blog,
|
6
|
+
:name => "My name",
|
7
|
+
).as_new_record)
|
8
|
+
end
|
9
|
+
|
10
|
+
describe "when calling field with a missing layout" do
|
11
|
+
before do
|
12
|
+
`mv app/views/blogs/name_field.html.erb app/views/blogs/name_field.html.erb.backup` unless `ls app/views/blogs/name_field.html.erb`.blank?
|
13
|
+
`mv app/views/forms/default/name_field.html.erb app/views/forms/default/name_field.html.erb.backup` unless `ls app/views/forms/default/name_field.html.erb`.blank?
|
14
|
+
`mv app/views/forms/default/field.html.erb app/views/forms/default/field.html.erb.backup` unless `ls app/views/forms/default/field.html.erb`.blank?
|
15
|
+
end
|
16
|
+
|
17
|
+
after do
|
18
|
+
`mv app/views/blogs/name_field.html.erb.backup app/views/blogs/name_field.html.erb` unless `ls app/views/blogs/name_field.html.erb.backup`.blank?
|
19
|
+
`mv app/views/forms/default/name_field.html.erb.backup app/views/forms/default/name_field.html.erb` unless `ls app/views/forms/default/name_field.html.erb.backup`.blank?
|
20
|
+
`mv app/views/forms/default/field.html.erb.backup app/views/forms/default/field.html.erb` unless `ls app/views/forms/default/field.html.erb.backup`.blank?
|
21
|
+
end
|
22
|
+
|
23
|
+
it "raises a missing template error" do
|
24
|
+
# lambda { render } .should raise_error(ErbForm::MissingTemplate)
|
25
|
+
lambda { render } .should raise_error(ActionView::Template::Error)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: erb_form
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Benjamin Lewis
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-02-21 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: simple_form
|
16
|
+
requirement: &2152397120 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.0.0.rc
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2152397120
|
25
|
+
description: Wrap form helper methods in re-usable erb templates.
|
26
|
+
email:
|
27
|
+
- 23inhouse@gmail.com
|
28
|
+
executables: []
|
29
|
+
extensions: []
|
30
|
+
extra_rdoc_files: []
|
31
|
+
files:
|
32
|
+
- .gitignore
|
33
|
+
- Gemfile
|
34
|
+
- Rakefile
|
35
|
+
- erb_form.gemspec
|
36
|
+
- lib/erb_form.rb
|
37
|
+
- lib/erb_form/builder.rb
|
38
|
+
- lib/erb_form/version.rb
|
39
|
+
- spec/spec_helper.rb
|
40
|
+
- spec/support/model.rb
|
41
|
+
- spec/test_app/.gitignore
|
42
|
+
- spec/test_app/.rspec
|
43
|
+
- spec/test_app/Gemfile
|
44
|
+
- spec/test_app/Rakefile
|
45
|
+
- spec/test_app/app/controllers/application_controller.rb
|
46
|
+
- spec/test_app/app/controllers/blogs_controller.rb
|
47
|
+
- spec/test_app/app/models/blog.rb
|
48
|
+
- spec/test_app/app/views/blogs/double_render_error.html.erb
|
49
|
+
- spec/test_app/app/views/blogs/double_render_field.html.erb
|
50
|
+
- spec/test_app/app/views/blogs/find_defaults.html.erb
|
51
|
+
- spec/test_app/app/views/blogs/find_layouts.html.erb
|
52
|
+
- spec/test_app/app/views/blogs/legacy_field.html.erb
|
53
|
+
- spec/test_app/app/views/blogs/missing_attribute_template_error.html.erb
|
54
|
+
- spec/test_app/app/views/blogs/missing_layout_template_error.html.erb
|
55
|
+
- spec/test_app/app/views/blogs/name_field.html.erb
|
56
|
+
- spec/test_app/app/views/forms/default/field.html.erb
|
57
|
+
- spec/test_app/app/views/forms/default/legacy_field.html.erb
|
58
|
+
- spec/test_app/app/views/forms/default/name_field.html.erb
|
59
|
+
- spec/test_app/app/views/forms/legacy/field.html.erb
|
60
|
+
- spec/test_app/app/views/forms/legacy/name_field.html.erb
|
61
|
+
- spec/test_app/config.ru
|
62
|
+
- spec/test_app/config/application.rb
|
63
|
+
- spec/test_app/config/boot.rb
|
64
|
+
- spec/test_app/config/database.yml
|
65
|
+
- spec/test_app/config/environment.rb
|
66
|
+
- spec/test_app/config/environments/development.rb
|
67
|
+
- spec/test_app/config/environments/test.rb
|
68
|
+
- spec/test_app/config/initializers/backtrace_silencers.rb
|
69
|
+
- spec/test_app/config/initializers/inflections.rb
|
70
|
+
- spec/test_app/config/initializers/mime_types.rb
|
71
|
+
- spec/test_app/config/initializers/secret_token.rb
|
72
|
+
- spec/test_app/config/initializers/session_store.rb
|
73
|
+
- spec/test_app/config/initializers/simple_form.rb
|
74
|
+
- spec/test_app/config/locales/simple_form.en.yml
|
75
|
+
- spec/test_app/config/routes.rb
|
76
|
+
- spec/test_app/db/migrate/20110629092717_create_blogs.rb
|
77
|
+
- spec/test_app/db/schema.rb
|
78
|
+
- spec/test_app/db/seeds.rb
|
79
|
+
- spec/test_app/lib/templates/erb/scaffold/_form.html.erb
|
80
|
+
- spec/test_app/script/rails
|
81
|
+
- spec/test_app/spec/spec_helper.rb
|
82
|
+
- spec/test_app/spec/views/blogs/double_render_error.html.erb_spec.rb
|
83
|
+
- spec/test_app/spec/views/blogs/find_defaults.html.erb_spec.rb
|
84
|
+
- spec/test_app/spec/views/blogs/find_layouts.html.erb_spec.rb
|
85
|
+
- spec/test_app/spec/views/blogs/missing_attribute_template_error.html.erb_spec.rb
|
86
|
+
- spec/test_app/spec/views/blogs/missing_layout_template_error.html.erb_spec.rb
|
87
|
+
homepage: ''
|
88
|
+
licenses: []
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
none: false
|
95
|
+
requirements:
|
96
|
+
- - ! '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
requirements: []
|
106
|
+
rubyforge_project: erb_form
|
107
|
+
rubygems_version: 1.8.11
|
108
|
+
signing_key:
|
109
|
+
specification_version: 3
|
110
|
+
summary: ERB templated forms
|
111
|
+
test_files:
|
112
|
+
- spec/spec_helper.rb
|
113
|
+
- spec/support/model.rb
|
114
|
+
- spec/test_app/.gitignore
|
115
|
+
- spec/test_app/.rspec
|
116
|
+
- spec/test_app/Gemfile
|
117
|
+
- spec/test_app/Rakefile
|
118
|
+
- spec/test_app/app/controllers/application_controller.rb
|
119
|
+
- spec/test_app/app/controllers/blogs_controller.rb
|
120
|
+
- spec/test_app/app/models/blog.rb
|
121
|
+
- spec/test_app/app/views/blogs/double_render_error.html.erb
|
122
|
+
- spec/test_app/app/views/blogs/double_render_field.html.erb
|
123
|
+
- spec/test_app/app/views/blogs/find_defaults.html.erb
|
124
|
+
- spec/test_app/app/views/blogs/find_layouts.html.erb
|
125
|
+
- spec/test_app/app/views/blogs/legacy_field.html.erb
|
126
|
+
- spec/test_app/app/views/blogs/missing_attribute_template_error.html.erb
|
127
|
+
- spec/test_app/app/views/blogs/missing_layout_template_error.html.erb
|
128
|
+
- spec/test_app/app/views/blogs/name_field.html.erb
|
129
|
+
- spec/test_app/app/views/forms/default/field.html.erb
|
130
|
+
- spec/test_app/app/views/forms/default/legacy_field.html.erb
|
131
|
+
- spec/test_app/app/views/forms/default/name_field.html.erb
|
132
|
+
- spec/test_app/app/views/forms/legacy/field.html.erb
|
133
|
+
- spec/test_app/app/views/forms/legacy/name_field.html.erb
|
134
|
+
- spec/test_app/config.ru
|
135
|
+
- spec/test_app/config/application.rb
|
136
|
+
- spec/test_app/config/boot.rb
|
137
|
+
- spec/test_app/config/database.yml
|
138
|
+
- spec/test_app/config/environment.rb
|
139
|
+
- spec/test_app/config/environments/development.rb
|
140
|
+
- spec/test_app/config/environments/test.rb
|
141
|
+
- spec/test_app/config/initializers/backtrace_silencers.rb
|
142
|
+
- spec/test_app/config/initializers/inflections.rb
|
143
|
+
- spec/test_app/config/initializers/mime_types.rb
|
144
|
+
- spec/test_app/config/initializers/secret_token.rb
|
145
|
+
- spec/test_app/config/initializers/session_store.rb
|
146
|
+
- spec/test_app/config/initializers/simple_form.rb
|
147
|
+
- spec/test_app/config/locales/simple_form.en.yml
|
148
|
+
- spec/test_app/config/routes.rb
|
149
|
+
- spec/test_app/db/migrate/20110629092717_create_blogs.rb
|
150
|
+
- spec/test_app/db/schema.rb
|
151
|
+
- spec/test_app/db/seeds.rb
|
152
|
+
- spec/test_app/lib/templates/erb/scaffold/_form.html.erb
|
153
|
+
- spec/test_app/script/rails
|
154
|
+
- spec/test_app/spec/spec_helper.rb
|
155
|
+
- spec/test_app/spec/views/blogs/double_render_error.html.erb_spec.rb
|
156
|
+
- spec/test_app/spec/views/blogs/find_defaults.html.erb_spec.rb
|
157
|
+
- spec/test_app/spec/views/blogs/find_layouts.html.erb_spec.rb
|
158
|
+
- spec/test_app/spec/views/blogs/missing_attribute_template_error.html.erb_spec.rb
|
159
|
+
- spec/test_app/spec/views/blogs/missing_layout_template_error.html.erb_spec.rb
|