Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Route Helpers #42

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ahoy_captain.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "ransack", ">= 2.3"
spec.add_dependency "turbo-rails", ">= 1.2"
spec.add_dependency "view_component", ">= 3"
spec.add_dependency "importmap-rails", ">= 1"
spec.add_dependency "importmap-rails", ">= 2"
spec.add_dependency "stimulus-rails", ">= 1.1"
spec.add_dependency "ahoy_matey", ">= 1.1"
spec.add_dependency "chartkick", ">= 4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<div class="divider my-1" data-toggle-target='toggleable'></div>
<% end %>
<li data-toggle-target='toggleable'>
<a class="block mx-auto pl-4 pb-1 " href="<%= AhoyCaptain::Engine.app.url_helpers.root_path %>">Clear all filters</a>
<a class="block mx-auto pl-4 pb-1 " href="<%= AhoyCaptain::Engine.routes.url_helpers.root_path %>">Clear all filters</a>
</li>
</div>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class GoalsTableComponent < DynamicTable
progress_bar value: :cr, max: 100, title: "Name" do |row|
search_params = view_context.search_params
query = search_params.dup.merge(q: { goal_in: row.goal_id}).to_query
url = AhoyCaptain::Engine.app.url_helpers.root_path + "?#{query}"
url = AhoyCaptain::Engine.routes.url_helpers.root_path + "?#{query}"
link_to row.item.name, url, target: :_top
end
number :unique_visits, title: "Uniques"
Expand Down
6 changes: 2 additions & 4 deletions app/helpers/ahoy_captain/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ def number_to_duration(duration)
end
end

def ahoy_captain_importmap_tags(entry_point = "application", shim: true)
def ahoy_captain_importmap_tags(entry_point = "application")
safe_join [
(javascript_importmap_shim_tag if shim),
(javascript_importmap_shim_nonce_configuration_tag if shim),
javascript_inline_importmap_tag(AhoyCaptain.importmap.to_json(resolver: self)),
javascript_import_module_tag(entry_point),
javascript_importmap_module_preload_tags(AhoyCaptain.importmap),
javascript_inline_importmap_tag(AhoyCaptain.importmap.to_json(resolver: self)),
].compact, "\n"
end

Expand Down