<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jeff 陳 on Medium]]></title>
        <description><![CDATA[Stories by Jeff 陳 on Medium]]></description>
        <link>https://medium.com/@jeffchen2264?source=rss-42c54c35b787------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*94yERLXGihKvpMDC90uq8A.jpeg</url>
            <title>Stories by Jeff 陳 on Medium</title>
            <link>https://medium.com/@jeffchen2264?source=rss-42c54c35b787------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 01:55:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jeffchen2264/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Ruby On Rails 實作食譜網站]]></title>
            <link>https://medium.com/@jeffchen2264/ruby-on-rails-%E5%AF%A6%E4%BD%9C%E9%A3%9F%E8%AD%9C%E7%B6%B2%E7%AB%99-2615b702be4f?source=rss-42c54c35b787------2</link>
            <guid isPermaLink="false">https://medium.com/p/2615b702be4f</guid>
            <dc:creator><![CDATA[Jeff 陳]]></dc:creator>
            <pubDate>Fri, 15 Sep 2017 04:20:55 GMT</pubDate>
            <atom:updated>2017-09-15T04:20:55.981Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cZMisrSpPySSxEyjnTAeng.png" /></figure><ol><li>輸入指令：<strong><em>rails generate scaffold post title:string photo:string content:text</em></strong>，按 Enter</li><li>然後再輸入指令：<strong><em>rake db:migrate</em></strong>，按 Enter</li><li>檢查檔案 db &gt; migrate &gt; schema.rb：確定剛才輸入的資料 posts 有在裡面，而且參數 title, photo, 與 content 都沒有錯字</li><li>點選上方綠色 Run Project</li><li>點選右下方的網址</li><li>在網址最右邊加上 /posts，按 Enter</li></ol><p>指令：</p><p><em>rails generate scaffold post發布一個臨時支架</em></p><p><em>title:string 抬頭</em></p><p><em>photo:string 抬頭</em></p><p><em>content:text抬頭以文字的方式呈現</em></p><p>rake db 整理資料夾</p><p>migrate 搬遷</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mOLVI1bxcDH9pyI-TuZhOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*ioWTLilzxB4io21OHUf1GQ.png" /></figure><ol><li>點選 New Post 開始新增資料</li><li>輸入 Title（標題）</li><li>在 Photo 欄位，給予一個圖片網址（見下面灰色方框）</li><li>在 Content 欄位，複製貼上食譜</li><li>點選 Create Post，會顯示剛輸入的資料，上方有綠字顯示新增成功</li><li>按 Back 會回到之前的介面，此時已經多了一筆資料</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*As4cBl6PMjj_GZUczKxtAw.png" /></figure><ol><li>點選左邊資料夾：（你設定的名字） &gt; app &gt; views &gt; posts &gt; index.html.erb</li><li>修改 &lt;h1&gt;Listing Posts&lt;/h1&gt;內容：&lt;h1&gt;我的私房食譜&lt;/h1&gt;</li><li>將</li></ol><p>&lt;td&gt; &lt;%= post.photo %&gt;&lt;/td&gt; 換成產生圖片連結，請找jpg連結</p><p>&lt;td&gt;&lt;img src=&quot;&lt;%= post.photo %&gt;&quot;&gt;&lt;/td&gt;</p><ol><li>將第 17 行的 &lt;tr&gt; 換成 &lt;tr class=&quot;post-row&quot;&gt;</li><li>將第 18 行的 &lt;td&gt; 換成 &lt;td class=&quot;title&quot;&gt;</li><li>存檔：左上角 &gt; File &gt; Save</li><li>前往網址，點選更新（或快捷鍵 F5），就能看到修改後的介面（圖片會顯示）</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZHCRj_NyuObrEK0gRVPKpA.png" /></figure><ol><li>點選 show 進入食譜畫面，會發現這裡的圖片還未顯示</li><li>點選 posts &gt; show.html.erb</li><li>將 &lt;strong&gt;Photo:&lt;/strong&gt;&lt;%= @post.photo %&gt; 換成 &lt;img src=&quot;&lt;%= @post.photo %&gt;&quot;&gt;&lt;/img&gt;</li><li>將第 3 行的 &lt;p&gt; 換成 &lt;p class=&quot;title&quot;&gt; 改成calss 的目的在於</li><li>將第 8 行 &lt;p&gt; 換成 &lt;p class=&quot;photo&quot;&gt; 可以去css裡面變更字體的大小</li><li>將第 12 行 &lt;p&gt; 換成 &lt;p class=&quot;content&quot;&gt; 樣式、顏色....等等等</li><li>存檔：左上角 &gt; File &gt; Save</li><li>前往網址，點選更新（或快捷鍵 F5），就能看到修改後的畫面（圖片會顯示）</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H6DJ8z5QIEzBrKWcpvZw0A.png" /></figure><ol><li>點選開啟 app &gt; assets &gt; stylesheets &gt; application.css</li><li>複製以下程式碼，並貼上到 application.css 最下方：</li></ol><pre>.title {<br>  font-size: <strong>14pt</strong>;<br>  font-weight: bold;<br>}            標題的字型大小</pre><pre>.photo {<br>  width: <strong>350px</strong>;<br>}    圖片的大小</pre><pre>.photo img {<br>    max-width: <strong>100%</strong>;<br>  border-radius: <strong>6px</strong>;<br>}   圖片的最大寬度邊寬大小</pre><pre>.content {<br>  font-size: <strong>10pt</strong>;<br>  width: <strong>350px</strong>;<br>}   內容的大小及寬度</pre><pre>table {<br>  border-spacing: <strong>0px</strong><br>}  長寬的距離大小</pre><pre>.post-row:hover {<br>    background-color: <strong>#eee</strong>;<br>}   滑鼠指到項目時的背景顏色</pre><pre>.post-row img {<br>  max-width: <strong>100px</strong>;<br>}   在POST ROW 畫面的圖片大小<br> <br>.post-row td {<br>  padding: <strong>5px</strong> <strong>10px</strong>;<br>}  在POST ROW 畫面的 上下距離、左右距離</pre><p><a href="http://www.1keydata.com/css-tutorial/tw/font.php">http://www.1keydata.com/css-tutorial/tw/font.php</a><br>有關於CSS語法的使用</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2615b702be4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[製冰可樂]]></title>
            <link>https://medium.com/series/%E8%A3%BD%E5%86%B0%E5%8F%AF%E6%A8%82-8d5159b8ff7?source=rss-42c54c35b787------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d5159b8ff7</guid>
            <dc:creator><![CDATA[Jeff 陳]]></dc:creator>
            <pubDate>Tue, 12 Sep 2017 04:57:58 GMT</pubDate>
            <atom:updated>2017-09-12T04:57:58.935Z</atom:updated>
            <content:encoded><![CDATA[<img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d5159b8ff7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>