Sha256: 4d3acb242268a3e6e5902298c587d088427d247d8e42883fde44ca75e755abb4

Contents?: true

Size: 862 Bytes

Versions: 4

Compression:

Stored size: 862 Bytes

Contents

require 'sinatra'

#
# Application Helpers
#
#  The last line of a method is always the return value
#
#  here you can define any helper methods that are available to your routes and your views
#  
#  -----------------------------------------------------
#  To create a helper method that returns something
#
#  def my_method
#    'something'
#  end
#
#  def my_method(param1, param2)
#     # remember to use doublequotes. single quotes will force a string
#     "using variables in strings #{param1}, #{param2}"
#  end
#  
#  use other helpers
#  
#  def is_user_logged_in?  
#    # there are loads of helpers in /koda/helpers that you could use
#    logged_in?
#  end
#

helpers do
  
  def style_link(path)
    "<link rel=\"StyleSheet\" href=\"#{path}\" type=\"text/css\">"
  end
  
  def script_link(path)
    "<script src=\"#{path}\"></script>"
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
koda-0.0.12 lib/helpers/app_helper.rb
koda-0.0.11 lib/helpers/app_helper.rb
koda-0.0.9 lib/helpers/app_helper.rb
koda-0.0.8 lib/helpers/app_helper.rb