mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
Rename simple_form_install to simple_form:install
This commit is contained in:
parent
303fb1fb1f
commit
ae32faf6eb
10 changed files with 36 additions and 30 deletions
|
@ -1,5 +1,8 @@
|
|||
* deprecation
|
||||
* Changed simple_form_install generator to simple_form:install
|
||||
|
||||
* enhancements
|
||||
* added support to presence validation to check if attribute is required or not (by github.com/gcirne)
|
||||
* Added support to presence validation to check if attribute is required or not (by github.com/gcirne)
|
||||
|
||||
== 1.1.3
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ Add it to your Gemfile:
|
|||
|
||||
Run the generator:
|
||||
|
||||
rails generate simple_form_install
|
||||
rails generate simple_form:install
|
||||
|
||||
And you are ready to go. Since this branch is aims Rails 3 support,
|
||||
if you want to use it with Rails 2.3 you should check this branch:
|
||||
|
@ -298,7 +298,7 @@ There are other options that can be configured through I18n API, such as require
|
|||
|
||||
SimpleForm has several configuration values. You can read and change them in the initializer created by SimpleForm, so if you haven't executed the command below yet, please do:
|
||||
|
||||
ruby script/generate simple_form_install
|
||||
rails generate simple_form:install
|
||||
|
||||
== TODO
|
||||
|
||||
|
|
|
@ -4,6 +4,5 @@
|
|||
|
||||
== Validations
|
||||
|
||||
* Add automatic :required check
|
||||
* Add unobstrusive javascript validations support
|
||||
* Add mask support (same as hint, but with JS)
|
||||
|
|
23
lib/generators/simple_form/install_generator.rb
Normal file
23
lib/generators/simple_form/install_generator.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
module SimpleForm
|
||||
module Generators
|
||||
class InstallGenerator < Rails::Generators::Base
|
||||
desc "Copy SimpleForm default files"
|
||||
|
||||
def self.source_root
|
||||
@_source_root = File.expand_path('../templates', __FILE__)
|
||||
end
|
||||
|
||||
def copy_initializers
|
||||
copy_file 'simple_form.rb', 'config/initializers/simple_form.rb'
|
||||
end
|
||||
|
||||
def copy_locale_file
|
||||
copy_file 'en.yml', 'config/locales/simple_form.en.yml'
|
||||
end
|
||||
|
||||
def copy_scaffold_template
|
||||
copy_file '_form.html.erb', 'lib/templates/erb/scaffold/_form.html.erb'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,4 +1,4 @@
|
|||
<%% simple_form_for(@<%= singular_name %>) do |f| %>
|
||||
<%%= simple_form_for(@<%= singular_name %>) do |f| %>
|
||||
<div class="inputs">
|
||||
<%- attributes.each do |attribute| -%>
|
||||
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
|
|
@ -1,19 +0,0 @@
|
|||
class SimpleFormInstallGenerator < Rails::Generators::Base
|
||||
desc "Copy SimpleForm default files"
|
||||
|
||||
def self.source_root
|
||||
@_source_root = File.expand_path('../templates', __FILE__)
|
||||
end
|
||||
|
||||
def copy_initializers
|
||||
copy_file 'simple_form.rb', 'config/initializers/simple_form.rb'
|
||||
end
|
||||
|
||||
def copy_locale_file
|
||||
copy_file 'en.yml', 'config/locales/simple_form.en.yml'
|
||||
end
|
||||
|
||||
def copy_scaffold_template
|
||||
copy_file '_form.html.erb', 'lib/templates/erb/scaffold/_form.html.erb'
|
||||
end
|
||||
end
|
|
@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|||
|
||||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
||||
s.authors = ["Jos\303\251 Valim", "Carlos Ant\303\264nio"]
|
||||
s.date = %q{2010-04-03}
|
||||
s.date = %q{2010-05-24}
|
||||
s.description = %q{Forms made easy!}
|
||||
s.email = %q{contact@plataformatec.com.br}
|
||||
s.extra_rdoc_files = [
|
||||
|
@ -17,11 +17,11 @@ Gem::Specification.new do |s|
|
|||
]
|
||||
s.files = [
|
||||
"init.rb",
|
||||
"lib/generators/simple_form_install/USAGE",
|
||||
"lib/generators/simple_form_install/simple_form_install_generator.rb",
|
||||
"lib/generators/simple_form_install/templates/_form.html.erb",
|
||||
"lib/generators/simple_form_install/templates/en.yml",
|
||||
"lib/generators/simple_form_install/templates/simple_form.rb",
|
||||
"lib/generators/simple_form/USAGE",
|
||||
"lib/generators/simple_form/install_generator.rb",
|
||||
"lib/generators/simple_form/templates/_form.html.erb",
|
||||
"lib/generators/simple_form/templates/en.yml",
|
||||
"lib/generators/simple_form/templates/simple_form.rb",
|
||||
"lib/simple_form.rb",
|
||||
"lib/simple_form/action_view_extensions/builder.rb",
|
||||
"lib/simple_form/action_view_extensions/form_helper.rb",
|
||||
|
|
Loading…
Reference in a new issue