diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 7307657..ab518e4 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -16,3 +16,10 @@ require('jquery') // // const images = require.context('../images', true) // const imagePath = (name) => images(name, true) + +$(document).on('turbolinks:load', function() { + $('.item').click(function(e) { + $('.active').removeClass('active'); + $(this).addClass('active'); +}); +}) \ No newline at end of file diff --git a/app/views/layouts/_navigation.html.erb b/app/views/layouts/_navigation.html.erb new file mode 100644 index 0000000..a6de208 --- /dev/null +++ b/app/views/layouts/_navigation.html.erb @@ -0,0 +1,13 @@ +
+ +
\ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 2958b53..a105372 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -10,6 +10,9 @@ - <%= yield %> +
+ <%= render 'layouts/navigation' %> + <%= yield %> +