ruby on rails - What's an appropriate way to override the view of a gem? -


i thought overkill unpack entire gem application. there way override single view provides?

this gem spree_easy_contact allows add contact form spree application. want tamper 1 of views alternative.

if gem namespaced, can namespace view in local application. example, if gem namespaced best_gem_ever, app structure this:

app - assets - controllers - helpers - mailers - models - views - - best_gem_ever - - - wonderful_controller - - - - index.html.erb 

at job, purposefully use technique allow clients overwrite front-end views while still pulling administrative views gem. works well.

one caveat, if create asset files store in local assets folder, reason asset pipeline doesn't pick them up. have explicitly added config.assets.precompile list.

hope helps!


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -