Moved form helpers from application_helper to a real FormHelper

This commit is contained in:
Godwin
2014-05-12 20:09:19 -06:00
parent 9ae7135c6a
commit ffa8239e42
30 changed files with 600 additions and 357 deletions
+5
View File
@@ -1,6 +1,8 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
#require "#{Rails.root}/app/helpers/bike_bike_form_helper"
#require '/app/helpers/bike_bike_form_helper.rb'
#require 'dotenv'; Dotenv.load ".env.local", ".env.#{Rails.env}"
# Require the gems listed in Gemfile, including any gems
@@ -26,5 +28,8 @@ module BikeBike
config.i18n.enforce_available_locales = false
#config.middleware.swap 'Rack::MethodOverride', 'Rack::MethodOverrideWithParams'
#config.i18n.exception_handler = I18n::MissingTranslationExceptionHandler.new
#require '/app/helpers/bike_bike_form_helper'
#ActionView::Base.default_form_builder
#config.action_view.default_form_builder = 'BikeBikeFormHelper::BikeBikeFormBuilder'
end
end
+5 -5
View File
@@ -15,27 +15,27 @@ module I18n
case method.to_s
when 'c', 'char', 'character', 'characters'
if size
return Forgery::LoremIpsum.characters size, options
return (Forgery::LoremIpsum.characters size, options).capitalize
end
return Forgery::LoremIpsum.character, options
when 'w', 'word', 'words'
if size
return Forgery::LoremIpsum.words size, options
return (Forgery::LoremIpsum.words size, options).capitalize
end
#return'LOREM'
return Forgery::LoremIpsum.word options
return (Forgery::LoremIpsum.word options).capitalize
when 's', 'sentence', 'sentences'
if size
return Forgery::LoremIpsum.sentences size, options
end
return Forgery::LoremIpsum.sentence options
return (Forgery::LoremIpsum.sentence options).capitalize
when 'p', 'paragraph', 'paragraphs'
if size
return Forgery::LoremIpsum.paragraphs size, options.merge({:sentences => 10})
end
return Forgery::LoremIpsum.sentences 10, options
when 't', 'title'
return Forgery::LoremIpsum.sentences 1, options
return (Forgery::LoremIpsum.sentences 1, options).capitalize
end
return nil
end