Skip to content

Instantly share code, notes, and snippets.

@acuppy
Created January 24, 2011 21:41
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 acuppy/794017 to your computer and use it in GitHub Desktop.
Save acuppy/794017 to your computer and use it in GitHub Desktop.
Adds the link_to_remote_if/unless helpers to a Rails application
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
@acuppy
Copy link
Author

acuppy commented Jan 24, 2011

require "link_to_remote_helper"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment