Customizing/Overriding Rails SimpleForm Gem -


i'm using rails gem simpleform, think question may applicable gem.

https://github.com/plataformatec/simple_form

it has lot of great features , customization, i'm looking go bit further. example, wish markup generated had no default classes inserted it, i'd still ability insert own manually. found remove of classes commenting out lines in gem files. outside of project-- want dry solution stay project when deploy production, preferably without having pack of gems.

i imagine common situation apply gem, , should able override gem wholly or partially adding customs files in project override gem... i'm not sure how.

any appreciated! thanks.

are talking monkey patching? gem has class in file

# simple_form_gem/lib/some_file.rb class   def some_method     puts 'a'   end end 

if want change output of #some_method can create initializer file , do

# config/initializers/my_monkey_patch_for_simple_form_gem.rb class   def some_method     puts 'duck punching'   end end 

your monkey patch affect a#some_method, , not other methods in a. make sure output of monkey patch won't break else in gem.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -