0

I am trying to have a dropdown (not part of a form) input where each option tag is a link to a controller action.

I've tried various ways of included it but nothing works

SELECT NAME="my-dropdown"
        OPTION VALUE="1111" steam turbine
        = link_to 'Action', path(my_action), class: 'nav-link'

Eyeslandic
  • 14,553
  • 13
  • 41
  • 54
d1596
  • 1,187
  • 3
  • 11
  • 25

1 Answers1

1

As said by @Eyeslandic, you can do your stuff like this in slim :

select name="my-dropdown" onchange="location = this.value;"
  option value="#{url_for 'Action', my_action_path}" class="nav-link"
    | steam turbine

You can take a look at these websites to help you to write in slim :

Emilien Baudet
  • 428
  • 4
  • 10