I am newbie with Rails and trying to make a simply Rails program and meet this problem.
I tried to make 3 buttons named Course, Location and Faction as you can see in this photo. Here is my code
<body> <nav> <div class="nav-wrapper"> <a href="#!" class="brand-logo">Logo</a> <a href="#" data-target="mobile-demo" class="sidenav-trigger"><i class="material-icons">menu</i></a> <ul class="right hide-on-med-and-down"> <li><a href="#">Course 1</a></li> <li><a href="<%= pages_location_path %>">Location</a></li> <li><% link_to "faction", pages_faction_path %>Faction</li> </ul> </div> </nav> <ul class="sidenav" id="mobile-demo"> <li><a href="#">Course 1</a></li> <li><a href="<%= pages_location_path %>">Location</a></li> <li><% link_to "faction", pages_faction_path %>Faction</li> </ul> <%= yield %> <script> document.addEventListener('DOMContentLoaded', function() { var elems = document.querySelectorAll('.sidenav'); var instances = M.Sidenav.init(elems, options); }); $(document).ready(function(){ $('.sidenav').sidenav(); }); </script> </body>
I wrote this code to make the button which named "Course", "Location", and "Faction". And I want when I click to the button "Location" and "Faction", it will link to "location page" and "faction page".
The button Location is ok, but the button Faction does not work. When I click on it, nothing happened. It only show the button.
Could you please give me some ideas to make this button work as well? Thank you very much.
from Recent Questions - Stack Overflow https://stackoverflow.com/questions/65376909/rails-button-not-enable-and-link-does-not-appear-how-to-solve-this-problem Nguyen Cuc http://ifttt.com/images/no_image_card.png
没有评论:
发表评论