Skip to content

Instantly share code, notes, and snippets.

@cfitz
Last active April 13, 2017 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfitz/aa6c81e26972c6312f4f7223aabfb700 to your computer and use it in GitHub Desktop.
Save cfitz/aa6c81e26972c6312f4f7223aabfb700 to your computer and use it in GitHub Desktop.
<%# This would go into views/welcome/index.html.erb %>
<%= setup_context :title => "Home", :suppress_breadcrumb => true %>
<div class="row">
<div class="col-md-12">
<%= render_aspace_partial :partial => "shared/flash_messages" %>
</div>
<div class="col-md-12" style="padding: 30px;">
<h1><%= I18n.t "welcome.heading" %></h1>
<%= say_meow %>
</div>
</div>
# A simple way to add helpers via a plugin
# this could be broken out in several way...
# for example, you could put the CatHelper in its own file an require_relative to that file
module CatHelper
def say_meow
"<b>meow</b>".html_safe
end
end
# here we reopen the ApplicationController ( after Rails has started )
# and stick in our helper module.
Rails.application.config.after_initialize do
ApplicationController.class_eval do
include CatHelper
helper_method :say_meow
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment