目前分類:Rails資訊 (8)

瀏覽方式: 標題列表 簡短摘要

update: 2011/08/31

Rails 3.1.0 釋出後,迅速的在 Guide 網站補上 Asset Pipeline 教學!

http://guides.rubyonrails.org/asset_pipeline.html

 

文章內教學的非常清楚,但我還沒空嘗試,因此僅留下 link 記錄。

http://blog.envylabs.com/2011/08/using-the-asset-pipeline-outside-of-rails-serving-and-running-coffeescript-2/

笨笨小蟹 發表在 痞客邦 留言(1) 人氣()

css3buttons_rails_helpers gem 是幫助你將網站套上精美的 github style button 。

https://github.com/thetron/css3buttons_rails_helpers

 

注意 3.0.x 只能使用 0.9.5 版, 3.1 之後就沒有問題可以使用最新版本,因此要記得在 3.0.x 時使用

gem 'css3buttons', '0.9.5'

裝好之後需要跑 generator ,所以請下

$rails g css3buttons

然後將 layouts 裡面的 stylesheet_link_tag 換成

<%= css3buttons_stylesheets %>

 

這個 helper 是將 CSS3 GitHub Buttons 這個網站提供的 css and html 將他包裝成 rails 的 helper 。

http://nicolasgallagher.com/lab/css3-github-buttons/

 

其實用法很簡單,如果沒有用 rails helper gem ,那就是自己將需要變成 button 的 html tag 加上 class。

加上 class="button" 就會變成按鈕,加上 class="button pill" 就會變成圓角按鈕,加上 class="button primary" 按鈕內的文字就會粗體顯示。

有 button 的 class 配合各種 icon 圖案,例如 class="button icon add" ,就可以完成精美的按鈕。

 

如果使用 rails helper gem ,那麼就可以很直覺的使用定義好的 helper 來套上漂亮的按鈕。

規則很簡單,就是將原本的 link_to method 改成 button_link_to ,然後把你要的效果(大小、重要、顏色、圖案)向前疊加,來看範例吧。

原本是

<%= link_to("Search", search_path) %>

改成 helper 寫法是

<%= big_search_button_link_to("Search", search_path) %>

大按鈕+搜尋圖案,看起來就非常的直覺!

 

如果需要變色也可以,例如原本是

<%= link_to("Delete", delete_path) %>

改成 helper 寫法是

<%= danger_remove_button_link_to("Delete", delete_path) %>

危險紅色+移除按鈕,非常完美!

 

如果你想用 Button Group 也沒問題,寫法是

<%= button_group do %>
  <%= button_link_to "Show", @post %>
  <%= button_link_to "Edit", edit_post_path(@post) %>
  <%= negative_trash_button_link_to "Delete", @post, :confirm => "Are you sure? %>
<% end %>

這樣就會出現連在一起的按鈕群組啦!

笨笨小蟹 發表在 痞客邦 留言(0) 人氣()

這是 Ruby Tuesday 邀請的新手場演講,希望可以讓新人上手更快速,有條路徑可以知道往前走。

演講分前後兩部分,前半是新人入門的訓練,後半則是我這幾個月來開發服務和活動所得出的心得和流程。
這次的演講有點太貪心,希望下次有機會可以將兩部分拆開,好好地各自演說一遍。 

 

 

笨笨小蟹 發表在 痞客邦 留言(0) 人氣()

這是 10/21 在公司內部報告的投影片,內容是關於我學習 rails 的經歷以及課程說明

投影片在此

笨笨小蟹 發表在 痞客邦 留言(0) 人氣()

http://github.com/pullmonkey/open_flash_chart

這個 plugin 可以幫助你快速的製作出很漂亮的圖表,因為圖表是 flash 檔,所以很漂亮、所以有點大(快500k)

目前的版本抓下來有 bug,請更新 RAILS_ROOT/public/ 下的 open-flash-chart.swf,就可以正常使用啦

使用說明與範例頁面:
http://pullmonkey.com/projects/open_flash_chart2/
http://pullmonkey.com/projects/open_flash_chart

笨笨小蟹 發表在 痞客邦 留言(0) 人氣()

Rails Wiki 上的文章,告訴你有哪些是保留字,還有一些用了會出問題的字。

Rails 禁用名字列表:
http://wiki.rubyonrails.org/rails/pages/ReservedWords 

笨笨小蟹 發表在 痞客邦 留言(0) 人氣()

雖然常常在用rake,但是運作方式跟寫法卻常搞不清楚。

railsenvy的這篇教學看完就可以大致了解rake。

rake教程英文版

rake教程中文版

笨笨小蟹 發表在 痞客邦 留言(0) 人氣()

http://rails.pixnet.net/blog

想接觸Rails的新手必看必練!

http://blog.xdite.net/

不定期有文章,就算看不懂也要看過。

http://ihower.tw/training/

RoR教育訓練課程網站,一樣必看。

笨笨小蟹 發表在 痞客邦 留言(0) 人氣()