Skip to content

Instantly share code, notes, and snippets.

@fokayx
Last active August 29, 2015 14:18
Show Gist options
  • Save fokayx/f529ecd6bc977b4bfe13 to your computer and use it in GitHub Desktop.
Save fokayx/f529ecd6bc977b4bfe13 to your computer and use it in GitHub Desktop.
ToDoList

Development QA

  • 多對多,跟直接一對多?一樣都是要這麼多筆,效能?
  • 上架與否作法

Hospital.where(status: "1") 前台沒有,後台有??有別的作法? controller -> scope unscope

  • 有辦法在列表做勾選,更改上架狀態?

  • if else 要寫在controller?model? 要怎麼寫

  • 修改欄位名稱、刪除table,如果在migrate過程中有執行,但後面某處噴錯,是不是也不會取消已做的更動??

  • serialize :欄位 塞category

  • search 結果的params是 "search keyword", 要如何做連結??

###RubyJJ

  • 刪掉分類,順便刪掉所屬的item
  • 動態表單
  • Location 資料庫寫死,
  • Hospital status? on : off
  • Hospital,前台不要,後台要
  • Hospital.status 直接勾選變更?
<% Hospital.all.each do |hospital| %>
  <% if hospital.status? %>
    <% link_to "on", hopsital_path(hospital, hospital: {status:"0"}), method: :patch %>
  <% else %>
    <% link_to "off", hospital_path(hosptial, hospital: {status:"1"}), method: :patch %>
  <% end %>
<% end %>

method: put or patch
link_to 改用 button_to 麻耶塞

tablename_ids[]

  • edit error -> missing required keys:

再設一個@hospital的變數,去網址抓params[:hospital_id],給form用囉

Swift

  • Assignment 1 extra task
  • 5/6 and task
  • Reading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment