total newbie here ^^ So I have a bunch of static pages in my footer that I would like to create a route for. Right now, I am using get to create the routes as such:
Rails.application.routes.draw do
root 'static_pages#home_page'
get 'static_pages/secret'
get 'static_pages/stripe_button'
get 'about_us', to: 'static_pages#about_us'
get 'rules', to: 'static_pages#rules'
get 'faq', to: 'static_pages#faq'
get 'community', to: 'static_pages#community'
get 'terms', to: 'static_pages#terms'
get 'privacy', to: 'static_pages#privacy'
end
Ideally, I am trying to condense all of that into a resources like so:
resources :static_pages, only: [:index] do
get :terms, :community, :privacy, :rules, :faq, :about_us, :stripe_button, :secret
end
Here is the footer li for the pages:
<div class="col">
<ul>
<li><%= link_to "About Us", 'about_us', class: 'nav-link d-inline-block' %></li>
<li><%= link_to "Rules", 'rules', class: 'nav-link d-inline-block' %></li>
<li><%= link_to "FAQ", 'faq', class: 'nav-link d-inline-block' %></li>
</ul>
</div>
<div class="col">
<ul>
<li><%= link_to "Community", 'community', class: 'nav-link d-inline-block' %></li>
<li><%= link_to "Terms", 'terms', class: 'nav-link d-inline-block' %></li>
<li><%= link_to "Privacy", 'privacy', class: 'nav-link d-inline-block' %></li>
</ul>
</div>
How do I get rid of all the gets and condense all of it into one resources?
ruby 2.7.1 rails 6.1.3
Thx a lot :)