Sha256: e06b21e797097ecda01b37ea1e2af38e5a5ffee482f5d9e26000093cfec58eaf

Contents?: true

Size: 474 Bytes

Versions: 14

Compression:

Stored size: 474 Bytes

Contents

- label = if options[:label_method].present?
  - case options[:label_method]
    - when Proc
      - options[:label_method].call(resource.send(name))
    - else
      - resource.send(name).try(options[:label_method])
- else
  - resource.send(name)
- link_to = options[:link_to]
- case link_to
  - when Proc
    = link_to(label, link_to.call(resource))
  - when String
    = link_to(label, link_to)
  - when Symbol
    = link_to(label, send(link_to))
  - when nil
    = label

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
rao-component-0.0.12.pre app/views/rao/component/table/body_cells/_association.html.haml
rao-component-0.0.11.pre app/views/rao/component/table/body_cells/_association.html.haml
rails-add_ons-3.0.0.pre1 app/views/component/table/body_cells/_association.haml
rao-component-0.0.10.pre app/views/rao/component/table/body_cells/_association.html.haml
rao-component-0.0.9.pre app/views/rao/component/table/body_cells/_association.html.haml
rao-component-0.0.8.pre app/views/rao/component/table/body_cells/_association.html.haml
rao-component-0.0.7.pre app/views/rao/component/table/body_cells/_association.html.haml
rao-component-0.0.6.pre app/views/rao/component/table/body_cells/_association.html.haml
rao-component-0.0.5.pre app/views/rao/component/table/body_cells/_association.html.haml
rao-component-0.0.4.pre app/views/rao/component/table/body_cells/_association.html.haml
rao-component-0.0.3.pre app/views/rao/component/table/body_cells/_association.html.haml
rao-component-0.0.2.pre app/views/rao/component/table/body_cells/_association.html.haml
rails-add_ons-2.2.1 app/views/component/table/body_cells/_association.haml
rails-add_ons-2.2.0 app/views/component/table/body_cells/_association.haml