Skip to content

Commit

Permalink
rails 7: wip.
Browse files Browse the repository at this point in the history
  • Loading branch information
hhorikawa committed Oct 27, 2024
1 parent e658e0e commit 61e9fae
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 14 deletions.
6 changes: 6 additions & 0 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Entry point for the build script in your package.json
import "@hotwired/turbo-rails"
import "./controllers"

Bulma.parseDocument();

document.addEventListener("turbo:load", () => {
Bulma.parseDocument();
});
3 changes: 2 additions & 1 deletion app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Relying Party (RP)
class Client < ApplicationRecord
[:contacts, :redirect_uris, :raw_registered_json].each do |serializable|
serialize serializable, JSON
# rails 7.2: 引数の数が変更. v7.1: 第2引数としてクラス名も可
serialize serializable, coder: JSON
end

# 'admin' account が client を所有する. => テナントの位置づけ
Expand Down
4 changes: 2 additions & 2 deletions app/views/authorizations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
<div class="field-body">
<div class="field">
<div class="control">
<%= submit_tag "Deny", name:'deny', class:'button is-danger' %>
<%= submit_tag "Approve", name:'approve', class:'button is-primary' %>
<%= submit_tag "Deny", name:'deny', class:'button is-danger', data:{turbo:false} %>
<%= submit_tag "Approve", name:'approve', class:'button is-primary', data:{turbo:false} %>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/clients/_client.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</details>
<footer>
<%= link_to 'Edit...', edit_client_path(client) %>
<%= link_to t('destroy'), client_path(client),
method: :delete, data:{confirm:'Are you sure?'} %>
<%= button_to t('destroy'), client_path(client),
method: :delete, data:{turbo_confirm:'Are you sure?'}, class:"button", form:{class:"is-inline-block"} %>
</footer>
</fieldset>
2 changes: 1 addition & 1 deletion app/views/clients/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<h1>New Client (RP)</h1>
<% content_for(:title) {"New Client (RP)"} %>

<article>
<%= form_for @client, :html => {:class => 'box'} do |f| %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/dashboard/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<h1><%= t('dashboard.title') %></h1>
<% content_for(:title) {t('dashboard.title')} %>

<nav>
<p>
Expand Down
3 changes: 1 addition & 2 deletions app/views/fake_users/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@


<h1 class="title">Fake Users</h1>
<% content_for(:title) {"Fake Users"} %>

<%= link_to 'New Fake User...', new_fake_user_path %>

Expand Down
4 changes: 2 additions & 2 deletions app/views/fake_users/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

<h1>New Fake User</h1>
<% content_for(:title) {"New Fake User"} %>

<%= form_with(model: @fake_user, class:'box') do |form| %>
<%= render 'form', form:form %>

<div class="actions">
<%= link_to 'Back', fake_users_path, class:'button is-light' %>
<%= link_to 'Cancel', fake_users_path, class:'button is-light' %>
<%= form.submit class:'button is-primary' %>
</div>
<% end %>
Expand Down
6 changes: 4 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,10 @@
</nav>


<div class="content is-normal">
<div class="container">

<h1 class="title"><%= content_for(:title) %></h1>

<% if (str = flash[:notice]) %>
<div class="notification is-info" >
<button class="delete"></button>
Expand All @@ -78,7 +80,7 @@

<%= yield %>

</div> <!-- /.content -->
</div> <!-- /.container -->



Expand Down
2 changes: 1 addition & 1 deletion app/views/top/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<h1><%= t('top.title') %></h1>
<% content_for(:title) {t('top.title')} %>

<article>
<p><%= t('top.description') %></p>
Expand Down

0 comments on commit 61e9fae

Please sign in to comment.