great084 / reform_estimate Goto Github PK
View Code? Open in Web Editor NEWリフォームの見積アプリ
リフォームの見積アプリ
UIフレームワークとしてbootstrapをインストールする。
カテゴリごとの金額を表示させる
ツールの選定
導入
設定
自動化
見積り基本情報に対して、見積明細の登録・参照が行えるようにする。
登録は一括登録できるようにする
見積登録画面で利用するカテゴリを選択できるようにする
Uniqueness validatorは廃止予定のため、変更すること
DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1. To continue case sensitive comparison on the :specification attribute in PriceTable model, pass case_sensitive: true
option explicitly to the uniqueness validator. (called from update at /Users/hiro/app/reform_estimate/app/controllers/price_tables_controller.rb:14)
作成した見積明細をpdf出力させる
見積概要 + 見積明細
見積明細をカテゴリごとのタブで切り替える
単価表と同様の方法で実装する
セレクトボックスの入力UIを改善
jQueryの導入を検討
https://www.webprofessional.jp/13-jquery-selectboxdrop-down-plugins/
flashメッセージの定義を行っているにも関わらず、画面に表示されない
def create
@estimate = Estimate.new(estimate_params)
if @estimate.save
flash.now[:success] = "見積を作成しました"
redirect_to estimates_path
else
puts "#{@estimate.errors.full_messages}"
flash.now[:danger] = "見積作成に失敗しました"
render :new
end
end
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
マスター登録画面をカテゴリーと単価表に分離する
ER−図を作成する。
以下が対象
User(ユーザ)
Estimate(見積)
Estimate(見積詳細)
UnitPrice(単価表)
Category(カテゴリー)
User認証認可を実現するために、devise gemのインストール&設定を行う。
王道パターンの以下
単価表登録をカテゴリごとのタブで切り替えて、登録・編集が行えるようにする。
以下のモデルDBを作成する。
見積作成画面で、カテゴリ、名称、仕様を指定すると、該当する単価をマスタから引っ張ってこれるようにする。
カテゴリを選択→ 該当する名称の候補がプルダウン表示
名称を選択→該当する仕様の候補がプルダウン表示
初期データの登録
seedデータを作成する
対象:User, Category, UnitPrice, Estimate, EstimateDetail
seedデータを充実させる
test userの全カテゴリに単価を登録させる
見積(親)の画面を作成する。
画面種類としては、
rails プロジェクトを作成する。
その際にruby, railsのバージョンおよびオプションを考えること
単価表画面上に、カテゴリーごとにタブをを設けて、カテゴリーごとに単価表を登録できるようにする
マスタの登録参照機能を作成する
対象:カテゴリ、単価表
同じ画面で登録できると良い
views配下に、master/index.html.erb(参照と登録共通)
パーシャルとして、_categories_form, _unit_price_form
type: post
masterコントローラ
index → 直近のcategory, unit_priceの一覧を提供
upsert_categories → カテゴリーの更新
upsert_price_tables → 単価表の更新
xxxx.find_or_initialize_by(key: params[:key])
xxxx.update(name: params[:value]
RSpecを導入する。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.