Sha256: afd531da57a91f5f6f4f8136be00d9242ab42f84dff33957077d3a7f3b1dbdf8

Contents?: true

Size: 864 Bytes

Versions: 4

Compression:

Stored size: 864 Bytes

Contents

# Methods added to this helper will be available to all templates in the application.
require 'localization'

module ApplicationHelper
  include Localization
  
  def image_button_to(source, title, options)
    html = ''
    html += image_submit_tag source, :class => 'image-submit', :alt => title, :title => title,
            :id => "#{title}_#{options[:id]}", :name => title, 
            :onclick => "form.action='#{url_for(options)}'"
  end

  def detour_to(title, options)
    link_to title, options.update({:return_controller => @controller.controller_name, :return_action => @controller.action_name, :return_id => params[:id]})
  end
  
  def back_or_link_to(title, options)
    if session[:detours]
      options = session[:detours].last.update({:return_from_detour => true})
puts "linked detour: #{options}"
    end
    link_to title, options
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
backlog-0.0.0 app/helpers/application_helper.rb
backlog-0.0.1 app/helpers/application_helper.rb
backlog-0.0.2 app/helpers/application_helper.rb
backlog-0.0.4 app/helpers/application_helper.rb