Created
January 24, 2011 21:41
-
-
Save acuppy/794017 to your computer and use it in GitHub Desktop.
Adds the link_to_remote_if/unless helpers to a Rails application
This file contains hidden or 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
module ActionView | |
module Helpers | |
module PrototypeHelper | |
def link_to_remote_if(condition, name, options = {}, html_options = nil) | |
condition ? link_to_remote(name, options, html_options) : name | |
end | |
def link_to_remote_unless(condition, name, options = {}, html_options = nil) | |
!condition ? link_to_remote(name, options, html_options) : name | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
require "link_to_remote_helper"