GitHub READ ME編集後エラー
エラー文(Git Hub上でREAD ME編集後)(かわいい絵文字をつけました)
git push後
To github.com:tamam03/style.git
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'github.com:tamam03/style.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
??
git statusしてみる
git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
???今行ったcommitあるよ言われてる
一旦この記事から
echo 'style' > README からの
git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
README
ほう・・?
https://qiita.com/zenfumi/items/7425b8e9a807659137ae
次にこちらから
git fetch
git push origin master(今回はmain)
→viエディタ起動。
コマンド切り替え出来ず、
脱出できる方法でとにかくExit→commit "N"など・・・
最終的にgit push できるようになったが
git status時
On branch main
Your branch is up to date with 'origin/main'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
README
こちらが表示されるように・・・
Read more
ja.yml日本語化での悪夢
```
ja:
views:
pagination:
first: <i class="fas fa-angle-double-left"></i>
last: <i class="fas fa-angle-double-right"></i>
previous: <i class="fas fa-angle-left"></i>
next: <i class="fas fa-angle-right"></i>
truncate: "..."
enums:
item:
status:
close: "非公開"
release: "公開"
only_clerk: "店舗スタッフのみ公開"
activerecord:
errors:
models:
item:
attributes:
brand:
required: "を選択してください"
models:
user: "ユーザー"
attributes:
user:
email: "メールアドレス"
name: "お名前"
name_kana: "フリガナ"
nick_name: "ニックネーム(表示用)"
password: "パスワード"
password_confirmation: "確認用パスワード"
brand_id: "所属ブランド"
brand_name: "ブランド名"
store_id: "所属店舗"
store_name: "店舗名"
models:
item: "投稿"
attributes:
item:
item_image: "投稿画像"
brand: "ブランド"
status: "公開ステータス"
text: "説明文"
errors:
format: "%{attribute}%{message}"
messages:
blank: を入力してください
empty: を入力してください
```
name: "お名前"この辺が日本語化されなくてなぜ・・と悩んだ数時間後
```
models:
user: "ユーザー"
item: "投稿"
attributes:
user:
email: "メールアドレス"
name: "お名前"
name_kana: "フリガナ"
nick_name: "ニックネーム(表示用)"
password: "パスワード"
password_confirmation: "確認用パスワード"
brand_id: "所属ブランド"
brand_name: "ブランド名"
store_id: "所属店舗"
store_name: "店舗名"
item:
item_image: "投稿画像"
brand: "ブランド"
status: "公開ステータス"
text: "説明文"
```
まとめたら解消しました・・
よかったけど時を戻したい。
Rails バリデーション 備忘録
devise関連は出てくるけど
作成したフォームに対してのエラーメッセージが表示されない・・・
render :new, status: :unprocessable_entity
これ入れたら一瞬で出ました
参考
後日詳しく
オブジェクト指向について
なんとなーくオブジェクト指向って聞いたことあるけど説明できない・・・
そもそもプログラミングって
→指示に対してその通りにコンピュータを動かすようにする(プログラムを作る)こと
この時、プログラム作る中での"表現方法"として
①オブジェクト指向プログラミング
②手書き型プログラミング
など分別される!(他にもあるが上記が代表的なもの)
その中でオブジェクト指向とは
「"モノ"と"操作"に分けてプログラムを組みコンピューターに動作させる表現方法」
さらに詳しく・・
例を挙げるとゲーム機であるswitch
(スプラトゥーン楽しそう・・・)
swithは
ゲーム機である本体
電源ボタン(マリオを走らせるBボタン)
といった
本体(=オブジェクト)+ 操作により
初めて遊べるようになります。
つまりこれを置き換えると
2つが揃うことで初めてアプリケーション完成となる、ということです。
ではもう少しアプリケーションを例に詳しく・・
あるアプリケーションの3つのボタン「登録ボタン」「編集ボタン」「削除ボタン」
このボタンの条件として「width: 100px」「background-color: red;」「color: white;」
とする時、
オブジェクト指向を使わないと、
同じ3つのプログラムを3回書かなければいけない!(さらに多いと腱鞘炎・・)
ではこれをオブジェクト指向として考えると・・
「ボタン」 = 「モノ」 として1つ作ってしまえば
別のボタンを作るときには変えたい部分(色など)のみ変えるだけで済みます。
これにより「効率的に開発」できる、ということです。
もう一つメリットとしては「エラー対処のしやすさ」が挙げられます。
例えば「ボタン」を押すことで「登録ができる」「ページが移行する」
というアプリケーションをオブジェクト指向の定義で表すと、
「ボタン」=「モノ」
「登録ができる」=「操作1」
「ページが移行する」=「操作2」
となります。
ではこの時エラーが出たとして・・(いやだな)
エラー文は
モノに対して
操作1に対して
操作2に対して
と分別されて出てくるので原因特定がしやすい!やったー!
簡易的ですがなんとなく説明はできそう・・。