2020-08-13から1日間の記事一覧
複数の画像をアップロードできるようにします。 コマンド yarn add dropzone@5.5.1 「app\assets\stylesheets\application.scss」ファイルに以下の記述を追加します。 記述追加 app\assets\stylesheets\application.scss(23行目) @import 'dropzone/dist/bas…
仕事の内容を登録できるようにします。 実際に登録して試すことはまだできません。 「app\views\gigs\edit.html.erb」ファイルを以下のように編集します。 app\views\gigs\edit.html.erb <section class="section"> <div class="container"> <div class="steps" id="stepsDemo"> </div></div></section>
仕事ビューを作成していきます。 「app\views\gigs\new.html.erb」ファイルの記述を以下の内容に変更します。 app\views\gigs\new.html.erb <section class="section"> <div class="container"> <div class="steps" id="stepsDemo"> <div class="step-item is-active is-primary"> <div class="step-marker">1</div> <div class="step-details">…</div></div></div></div></section>
仕事コントローラを作成していきます。 コマンド rails g controller Gigs new create edit update show --no-test-framework ルートの設定をします。 自動で書かれた記述は削除します。 記述追加 config\routes.rb(17行目) resources :gigs config\routes.r…
仕事のモデルを作成します。 コマンド(4つ) rails g model Category name --no-test-framework 一文です。 rails g model Gig title video active:boolean has_single_pricing:boolean user:references category:references --no-test-framework 一文です…
ユーザープロフィールページを作成します。 「app\controllers\users_controller.rb」ファイルに以下のメソッドを追加します。 記述追加 app\controllers\users_controller.rb(8行目) def show @user = User.find(params[:id]) end app\controllers\users_co…