Archive for the ‘Ruby on Rails’ Category

開始用del.icio.us

Wednesday, May 30th, 2007

把大部分的Flash/Flex/ActionScript/Web Design/等參考連結,都放到delicious.com了。
我的 del.icio.us
也可以在旁邊的sidebar裡頭找到我的delicious :)

Apatana IDE is out.

Friday, May 11th, 2007

Apatana logo
Apatana是一個專門為了Javascript , CSS , Ruby on Rails 製作的免費IDE, 可以加掛在Eclipse上面,也能獨立安裝,他與先前的RadRail結合了, 前幾天已經推出了新版:
到這裡下載
結合Rails
變更語言

Rails rendering routes for views and templates

Friday, May 11th, 2007

使用Rails建立view和template時, 常常會用到:

image_tag("img_path")
stylesheet_link_tag "css_name"

這些都很好用, 可以在 ActionView::Helpers::AssetTagHelper 這裡找到, 但是…
如果我要用flash movie那怎麼辦? 並沒有 flash_tag() 的 AssetTagHelper阿~
這時候我只想到用笨的方法, 就是直接把Embed的tag放到view的rhtml裡頭, 那 .swf 檔案要放哪? 如果直接放在 app/view/[controller]/swf/…
絕對找不到, 因為:

Rail 預設的 asset path 是在 root
image_tag #=> 會去找root/images/
stylesheet_link_tag #=> 會去找 root/stylesheets/

換句話說, 如果我在一個叫做test.rhtml 的view 裡寫上: < embed src=”flash.swf” … > 那麼 Rails會自動去找 localhost:3000/flash.swf , 這樣當然找不到, 因此,我就很笨很單純地建立一個新目錄swf在 root下 : root/swf ,把flash.swf 放進去, 之後, 任何view.rhtml檔(app/view/xxx.rhtml), 需要放入flash swf 檔的話, 就把 src 路徑改成 /swf/flash.swf 就可以順利讀到了!
註: 此處的swf 是由Flash publish的swf(還有html)
***註: 記得要加上 ‘ / ‘ ; 是: /swf/flash.swf ; 不是 swf/flash

更新:
如果遇到Flex輸出的html與swf那該如何呢? 以下是一個rhtml(某個action的view), 把Flex 輸出的html直接copy進去就可以了, 但是有些地方要改…

[html]

…略

<%= javascript_include_tag "AC_OETags"%>
<%= javascript_include_tag "history"%>
…略




[/html]

AC_FL_RunContent最重要!!!!

The Father of Ruby - 高橋メソッド

Thursday, May 10th, 2007

His presentation goes … very … ‘agile’ and light-weight. Also, it’s much more funny than I imagine.
Awesome. For Japanese web slang, I should say: wwwwwwww~~~~ :)
ps: ‘w’ means ’smile’ in jp slang.

系統設計流程圖

Thursday, May 3rd, 2007

最近在溫書, 溫以前沒有好好研究的SA(System Analysis)教科書(Systems Analysis and Design Methods 5th)system analysis and design methods 5th,現在出到第七版了!system analysis and design methods 7th
老弄不清Workflow Diagram (Process model , flow chart…)和 Data Flow Diagram ,現在稍微分辨出了一點:
簡單的說, workflow diagram/Process model/flow chart 不會有 data store 的symbol(entity), 當然 Data Flow Diagram會有, 如下:
Flowchart:
flow chart
Process Modeling( Workflow Diagram )
workflow-process-modeling
Data Flow Diagram
Data Flow Diagram

更多例子請看這裡…

ROR layout用法

Wednesday, May 2nd, 2007

Layouts are controller-specific. If the current request is being handled by a
controller called store, Rails will by default look for a layout called store (with
the usual .rhtml or .rxml extension) in the

app/views/layouts

directory. If you
create a layout called

application

in the layouts directory, it will be applied to all
controllers that don’t otherwise have a layout defined for them.
You can override this using the layout declaration inside a controller:
[c]
class StoreController < ApplicationController
layout "standard"
# ...
end
[/c]

用ERB寫出帶有連結的圖片

Wednesday, May 2nd, 2007

很簡單:

ref module:  ActionView::Helpers::AssetTagHelper

[c]
<%= link_to image_tag("my_pic.png", :alt=>“info”) , :controller=>”somewhere”%>
[/c]

link_to 回傳: a href=….
image_tag 回傳: img src=…

合起來,就是帶有連結的圖片了!

Code Conventions for the Java

Wednesday, April 25th, 2007

Download Here

寫程式的好友們,
都要把程式寫好, 排版要工整 , 段落要通順, 文意流暢之外, 還要運作順暢, 最好, 在把註解寫的清楚完整之餘, 還能寫段笑話, 讓大家看的開心, 自己也窩心…
說真的, 我常常看不懂自己以前的code, 雖然我已經寫了註解, 希望短期之內, 可以改善這種情形~

My RubyOnRails Working Flow

Tuesday, April 17th, 2007

ROR system architecture

I am learning these technologies. Facing such new tech often makes me exhausted. That’s why I am still a newbie. Well, it’s not a good thing, so I have to find a working flow for me. It is. :)

  • update: mollio css templates , to use these great template to create web app quickly.
  • update2: Adobe’s new Flash Cs3 has been released. But I totally CANNOT afford it. However, there is another way: buying as a student. I only need Flash CS3 , I think. Other collections contain too many software rarely used by me.
  • update3: I have encountered Chinese characters problem on MySQL. Here are some references:
    MySQL 5.0 Manual
    ROR unicode support issue
    While manipulating rhtml with unicode( utf8 ), the most important step is making sure that the rhtml file itself is unicode encoded! If you use Eclipse, you will find the default file encoding is MS950 ; you must change it.
  • update4: Brilliant Javascript effects library! Check it out: script.aculo.us
  • update5: To start a server with different port, execute this command:
    ruby ./script/server --port xxxx
  • update6: To use Dreamweaver as ROR IDE, you can download this dreamweaver extension.(origin: RubyWeaver )
  • update7: I forgot my MySQL root password AGAIN… so: see this troubleshooting.

Ruby on Rails on my host

Wednesday, April 11th, 2007

I am hosted by BlueHost. I search for a article stating how to create rails project on my domain.

See the article here( Blue Host )

BTW, Vixiom Axioms.com posted another great guide with MediaTemple.

See the article here( Media Temple )

Now, I could enjoy my rails app!!!