Sha256: 2e079eac168e7aa59ce123d599a3cb6dda892b7d4e0bc2a9ea47f96b713c610d

Contents?: true

Size: 390 Bytes

Versions: 1

Compression:

Stored size: 390 Bytes

Contents

# helper
inject_into_file "app/helpers/application_helper.rb", after: "module ApplicationHelper\n" do
<<-EOF

  def link_for obj, name = :name, i: false, b: false
    return nil unless obj
    raise "not respond to \#{name}" unless obj.respond_to? name

    html = link_to obj.send(name), obj
    html = content_tag :i, html if i
    html = content_tag :b, html if b
    html
  end
EOF
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crosstie-0.0.7 lib/crosstie/templates/helper.rb