yu-croco / airbnb_clone Goto Github PK
View Code? Open in Web Editor NEWThis application is clone application of airbnb for learning Ruby on Rails.
This application is clone application of airbnb for learning Ruby on Rails.
テンプレートにstyleが直書きされている箇所があるので、scssに分離する。
ビューテンプレートにjsを直書きしている箇所があるので、jsファイルに分離する。
対応時にはwebpackerを調べること。
rails 5 の webpacker 使えば、特定のファイルだけに特定の JS 読み込むのも簡単です。
そこまでやる必要はないですが。
ご指摘元のコメント
Listing から find_by するのは少し怖いです。
他の User の Listing をまちがって取ってくる可能性があるからです。リクエスト次第では有りえます。以下のように探してくれば、そのユーザ以外の Listing は表示されないです。
current_user.listings.find_by(...)
現状ではRailsのform_for/form_tagを使用してformタグを作成しているので、simple_formで書き換える。
現状では、Listingsコントローラに無理にアクションを入れている。
(basics、description、address、price、photos、calendar、bankaccount)
これらをListingsコントローラから切り出して、それぞれに合うコントローラを作成する。
[コメント元]
間違いではないのですが、こういった controller は RESTful の**に反していて、controller が複雑になるかなと思います。
http://postd.cc/how-dhh-organizes-his-rails-controllers/あとは、可読性も下げる気がしています。
ListingsController#address がどういう情報を表しているのかわかりにくかったりします。
ListingAdressesController#show or #index とかにしておければ、何を表しているのかわかりやすいです。
コメント元
house_type は選択式ですよね?
これだと意図しない選択肢が DB に残る可能性があって危険です。
enumerize を使うと良いかと。
現状、issueへの記載方法が定まっていないのでおよそのフォーマットを決める。
フォーマットはwikiに記載予定。
[不具合内容]
githubへのpush時に発火するテストが正常に走らない。
(Rails 5.x系でCircle CI繋ぐと、割りと遭遇してるっぽい。?)
bundler:
failed to load command: rspec (/home/circleci/repo/vendor/bundle/ruby/2.4.0/bin/rspec)
LoadError: cannot load such file -- rspec_junit_formatter
現状でDBスキーマでnull:false対応ができていない箇所があるので、null:falseを追加する。
[対象テーブル/カラム名]
[コメント元]
とくに boolean については null: false は徹底したほうがよいです。
true, false, nil, の 3 パターンになってしまって実装が面倒になります。
http://qiita.com/jnchito/items/a342b64cd998e5c4ef3d
circle ci 使うと、github 上でテスト実行してもらえるから便利ですよ!
1 つのレポジトリーだけなら無料でつかえます。
http://qiita.com/noboru_i/items/7d300eb63ae667bf8dc2
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.