-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # app/views/layouts/hotsheet/_sidebar.html.erb
- Loading branch information
Showing
13 changed files
with
96 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<%# locals: (attribute:, model:, record:) %> | ||
|
||
<%= turbo_frame_tag "#{dom_id record}-#{attribute}" do %> | ||
<div data-controller="editable-attribute" | ||
data-editable-attribute-broadcast-url-value="<%= broadcast_edit_intent_path %>" | ||
data-editable-attribute-resource-name-value="<%= model.table_name %>" | ||
data-editable-attribute-resource-id-value="<%= record.id %>"> | ||
<div class="readonly-attribute" | ||
data-editable-attribute-target="readonlyAttribute" | ||
data-action="click->editable-attribute#displayInputField"> | ||
<%= record.public_send attribute %> | ||
</div> | ||
|
||
<div data-editable-attribute-target="attributeForm" style="display:none"> | ||
<%= form_for record, url: "#{root_path}#{model.table_name}/#{record.id}" do |f| %> | ||
<%= f.text_field attribute, class: "editable-input", data: { | ||
editable_attribute_target: "attributeFormInput", | ||
action: "keydown.enter->editable-attribute#submitForm blur->editable-attribute#submitForm" | ||
} %> | ||
<% end %> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class TableNameTest < ApplicationRecord | ||
self.table_name = "different_db_name" | ||
end |
4 changes: 4 additions & 0 deletions
4
spec/dummy/app/models/very_long_model_name_for_overflow_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class VeryLongModelNameForOverflowTest < ApplicationRecord | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
spec/dummy/db/migrate/20241104095444_create_more_models.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
class CreateMoreModels < ActiveRecord::Migration[8.1] | ||
def change | ||
overflow_test | ||
different_db_name | ||
end | ||
|
||
private | ||
|
||
def overflow_test | ||
create_table :very_long_model_name_for_overflow_tests do |t| | ||
t.string :even_longer_column_name_for_overflow_test | ||
t.timestamps | ||
end | ||
end | ||
|
||
def different_db_name | ||
create_table :different_db_name do |t| | ||
t.string :title | ||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters