GithubHelp home page GithubHelp logo

sanemat / actionview-link_to_blank Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 3.0 81 KB

Add helper method, link_to_blank, equal to link_to with target _blank

Home Page: https://rubygems.org/gems/actionview-link_to_blank

License: MIT License

Ruby 100.00%

actionview-link_to_blank's People

Contributors

sanemat avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

actionview-link_to_blank's Issues

Raise error with setting target?

Behavior 1: To respect the intent of the user

link_to_blank('foo', target: '_parent')
#=> <a href="foo" target="_parent">

Behavior 2: Suggest user should use link_to, instead of link_to_blank

link_to_blank('foo', target: '_parent')
#=> Raise Error

Behavior 3: Method name include blank

link_to_blank('foo', target: '_parent')
#=> <a href="foo" target="_blank">

I prefer to 2

FIXME escape feature

This does not pass tests.

# FIXME
# assert_equal %{&lt;b&gt;Showing&lt;/b&gt;}, link_to_unless(true, "<b>Showing</b>", url_hash)
# assert_equal %{<a href="/">&lt;b&gt;Showing&lt;/b&gt;</a>}, link_to_unless(false, "<b>Showing</b>", url_hash)
# assert_equal %{<b>Showing</b>}, link_to_unless(true, "<b>Showing</b>".html_safe, url_hash)
# assert_equal %{<a href="/"><b>Showing</b></a>}, link_to_unless(false, "<b>Showing</b>".html_safe, url_hash)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.