Last active
April 13, 2017 20:52
-
-
Save cfitz/aa6c81e26972c6312f4f7223aabfb700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%# 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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