Skip to content

Commit

Permalink
tweak console
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpeterson committed Nov 20, 2024
1 parent 39c3369 commit 340fc59
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/views/application/_debug.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- console if Rails.env.development?

= ui.card title: "Debug" do |card|
= card.section do
= ui.field label: "Params" do
Expand All @@ -7,4 +9,3 @@
= ui.code scope.to_sql

= yield :debug
= console
2 changes: 1 addition & 1 deletion app/views/application/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

= ui.page :wide, title:, actions: do |page|
= page.left do
= render "debug" if params.key?(:debug)
= render "filters"
= render "debug" if debug?

= page.body { body }
3 changes: 2 additions & 1 deletion lib/cafe_car/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def table_for(objects, **options, &block)
CafeCar[:TableBuilder].new(self, objects:, **options, &block)
end

def debug? = params.key?(:debug)
def debug? = params.key?(:debug)
def console? = params.key?(:console)

def partial?(path)
prefixes = path.include?(?/) ? [] : lookup_context.prefixes
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

config.active_job.verbose_enqueue_logs = true

config.action_view.annotate_rendered_view_with_filenames = true
config.action_view.annotate_rendered_view_with_filenames = false

# Raise error when a before_action's only/except options reference missing actions
config.action_controller.raise_on_missing_callback_actions = true
Expand Down

0 comments on commit 340fc59

Please sign in to comment.