Skip to content

Commit

Permalink
Current.user in cafe_car
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpeterson committed Nov 21, 2024
1 parent cdf8a18 commit af4183e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Empty file.
15 changes: 10 additions & 5 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
!!!
%html{lang: I18n.locale}
%head
%title= @title
%title= @title || content_for(:title)
%meta{name: "viewport", content: "width=device-width,initial-scale=1"}
%meta{name: "turbo-prefetch", content: "true"}
%meta{name: "turbo-refresh-method", content: "morph"}
%meta{name: "apple-mobile-web-app-capable", content:"yes"}
%meta{name: "mobile-web-app-capable", content:"yes"}
%meta{name: "turbo-prefetch", content: "true"}
%meta{name: "turbo-refresh-method", content: "morph"}
= csrf_meta_tags
= csp_meta_tag
-# = javascript_include_tag "cafe_car", type: :module
= render "head"
= yield :head
= stylesheet_link_tag "cafe_car", "data-turbo-track": "reload"
= javascript_importmap_tags
-# = javascript_include_tag "cafe_car", type: :module
= yield(:head)
%body
= render "nav"
Expand Down
1 change: 1 addition & 0 deletions lib/cafe_car/current.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module CafeCar
class Current < ActiveSupport::CurrentAttributes
attribute :request_id, :user_agent, :ip_address
attribute :user
end
end
1 change: 0 additions & 1 deletion test/dummy/app/models/current.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
class Current < CafeCar::Current
attribute :user
end

0 comments on commit af4183e

Please sign in to comment.