最新版 |
編集中の文章 |
2行目: |
2行目: |
| [[category:memo|{{PAGENAME}}]] | | [[category:memo|{{PAGENAME}}]] |
| | | |
− | % pg_restore --verbose --clean --no-acl --no-owner -h localhost -U jq -d tepnote2_development latest.dump
| |
− |
| |
− | == メソッド ==
| |
| {| class="wikitable sortable" | | {| class="wikitable sortable" |
| |- | | |- |
11行目: |
8行目: |
| | followed_user? || 自分自身または自分がフォローされていたらTRUEを返す || app/helpers/sessions_helper.rb | | | followed_user? || 自分自身または自分がフォローされていたらTRUEを返す || app/helpers/sessions_helper.rb |
| |- | | |- |
− | | current_note|| 使用中のノート名を取得する ヘッダーに表示する || app/helpers/sessions_helper.rb | + | | セル内のテキスト || セル内のテキスト || セル内のテキスト |
− | |-
| |
− | | current_note_id || 中身はparams[:note_id]だけ || app/helpers/sessions_helper.rb
| |
− | |-
| |
− | | user_role || userのロール どの権限でフォローしたか || app/models/user.rb
| |
− | |-
| |
− | | note_role || note(jiin)のアクセスレベル || app/controllers/application_controller.rb
| |
− | |-
| |
− | | action_role || アクションへのアクセスコントロール || app/controllers/
| |
− | |-
| |
− | | controller_name_overlap || コントローラー名の重複登録を避ける || app/controllers/action_roles_controller.rb
| |
− | |-
| |
− | | set_feed_jiins || ユーザーのノート(jiin)を表示する すべてのページで必要 || app/controllers/
| |
− | |-
| |
− | | || ||
| |
− | |-
| |
− | | || ||
| |
− | |-
| |
− | | || ||
| |
− | |-
| |
− | | || ||
| |
− | |}
| |
− | | |
− | == generate ==
| |
− | {| class="wikitable sortable"
| |
− | |-
| |
− | ! ||
| |
− | |-
| |
− | | || rails generate model client name:string yomi:string ie_id:integer nusi:boolean memo:string order:integer generation:string user:references note:references
| |
− | |-
| |
− | | やり直し || rails destroy model client name:string yomi:string ie_id:integer nusi:boolean memo:string order:integer generation:string user:references note:references
| |
− | |-
| |
− | | || rails generate controller settings index property bankbook account description postscript
| |
− | |-
| |
− | | || rails generate controller role_settings index show new edit create update destroy
| |
− | |-
| |
− | | やり直し || rails destroy controller role_settings index show new edit create update destroy
| |
− | |-
| |
− | | || rails generate migration add_admin_to_users admin:boolean
| |
− | |-
| |
− | | やり直し || rails destroy migration add_order_to_categories order:integer
| |
− | |-
| |
− | | ||
| |
− | |}
| |
− | | |
− | == migration ==
| |
− | {| class="wikitable sortable"
| |
− | |-
| |
− | ! 見出しテキスト !! 見出しテキスト
| |
− | |-
| |
− | | || rails db:migrate
| |
− | |-
| |
− | | || rails db:migrate:status
| |
− | |-
| |
− | | やり直し || rails db:rollback STEP=1 rails db:rollback STEP=2 [https://railsguides.jp/active_record_migrations.html 参考]
| |
− | |-
| |
− | | || rails db:seed
| |
| |- | | |- |
− | | || rails db:migrate:reset | + | | セル内のテキスト || セル内のテキスト || セル内のテキスト |
− | |-
| |
− | | セル内のテキスト || セル内のテキスト | |
| |} | | |} |
| | | |
− | == 覚書 ==
| |
| {| class="wikitable sortable" | | {| class="wikitable sortable" |
− | ! colspan="2" | 覚書
| |
− | |-
| |
− | | rowspan="2" | map
| |
− | | <nowiki>= f.select :role_num, role_num.map {|k,j| [j, k]}</nowiki>
| |
− | |-
| |
− | | <nowiki>= f.select :belong, @feed_jiins.map {|j| [j.jiin_name, j.id]}</nowiki>
| |
− | |-
| |
− | | javascript読み込み || <%= javascript_pack_tag 'shared/note_form' %>
| |
− | |-
| |
− | | ルーティングの確認 || rails routes
| |
− | |-
| |
− | | s3セッティング || heroku config:set AWS_ACCESS_KEY_ID="xxxx"
| |
− | |-
| |
− | | || heroku config:set AWS_SECRET_ACCESS_KEY="xxxx"
| |
− | |-
| |
− | | || heroku config:set AWS_BUCKET="tepnote"
| |
− | |-
| |
− | | || heroku config:set AWS_REGION="ap-northeast-1"
| |
− | |-
| |
− | | 郵便番号から検索 || app/views/layouts/application.html.erb [https://pinzolo.github.io/2017/03/15/yubinbango-with-turbolinks.html 参考] <script src="https://yubinbango.github.io/yubinbango/yubinbango.js" charset="UTF-8"></script>
| |
− | |-
| |
− | | 【jQuery】要素を指定するセレクタの使い方 || [http://www.hp-stylelink.com/news/2013/11/20131122.php 参考]
| |
− | |-
| |
− | | 一括登録フォーム || [https://rails.densan-labs.net/form/bulk_registration_form.html 参考]
| |
− | |-
| |
− | | Prawn pdfを出力するリンク ||<%= link_to "PDFを表示", 適宜指定_path(format: "pdf") %>
| |
− | |-
| |
− | | Turbolinks || [https://www.autovice.jp/articles/142 参考]
| |
− | |-
| |
− | | Calendar || [https://code-notes.com/lesson/31 参考]
| |
| |- | | |- |
− | | 0埋め || format
| + | ! 見出しテキスト |
| |- | | |- |
− | | puma.rb | workers Integer(ENV['WEB_CONCURRENCY'] || 2) [https://qiita.com/yo-iida/items/20e86e913000f6d080ca 参考] | + | | rails generate scaffold name:string yomi:string ie_id:integer nusi:boolean memo:string order:integer generation:string user:references note:references |
| |- | | |- |
− | | モーダルウィンドウ || [https://tech-dig.jp/js-modal/ 参考] | + | | セル内のテキスト |
| |- | | |- |
− | | | + | | セル内のテキスト |
| |} | | |} |
| | | |
| フォローされたらpostが見える | | フォローされたらpostが見える |
| followed_user_microposts ass/helpers/users_helper | | followed_user_microposts ass/helpers/users_helper |
− |
| |
− | == bootstrap javascriptが突然動かなくなった ==
| |
− | yarn add bootstrap@next
| |
− | バージョンを選んでインストールできる gemと同じ3.4.1を選択
| |
− | yarn add @popperjs/core
| |
− | 以上でyarnからbootstrapが入った
| |
− | 続いて設定
| |
− | app/javascript/packs/application.js app/javascript/stylesheets/application.scss app/views/layouts/application.html.erb
| |
− | 次にjavascript
| |
− | yarn add jquery
| |
− | 続いて設定
| |
− | config/webpack/environment.js javascript/packs/application.js
| |
− | 突然動かなくなった原因はわからない
| |
− | webpackerの上書きもした
| |
− | rails webpacker:install
| |
− | rails webpacker:compile
| |
− | 動作確認
| |
− | <nowiki><p>Javascriptは動いていません</p></nowiki>
| |
− | <script type="text/javascript">
| |
− | $(document).ready(function() {
| |
− | $("p").text("Javascriptは動いています");
| |
− | });
| |
− | </script>
| |
− |
| |
− | == エラー ==
| |
− | ActiveSupport::MessageEncryptor::InvalidMessage
| |
− | % EDITOR="vi" bin/rails credentials:show
| |
− | % EDITOR="vi" bin/rails credentials:edit
| |
− | % heroku config:set RAILS_MASTER_KEY=`cat config/master.key`
| |