<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    躺在沙灘上的小豬

    快樂的每一天

    #

    Feedburner

    http://feeds.feedburner.com/martinx

    posted @ 2006-05-19 09:27 martin xus| 編輯 收藏

    Integrate FCKEditor with your Ruby on Rails application

    http://www.joshuamcharles.com/rails/fckeditor.html

    posted @ 2006-05-17 17:04 martin xus| 編輯 收藏

    Rails Document

    http://delynnberry.com/pages/rails-chm-documentation/

    posted @ 2006-05-16 20:30 martin xus| 編輯 收藏

    Post and Get

    在《Agile Web Development with Rails》中看到如下的一句話

    ???? If it has no associated data, it will come in as a GET request. If instead it contains form data, we’ll see a POST. Inside a Rails controller, the request information is available in the attribute request. We can check the request type using the methods get?( ) and post?( ).

    也就是說當沒有數據的時候,是get,而有數據的時候則是post.

    例如我們在用戶登錄的時候,首先轉到登錄界面,這個時候當然還沒有數據,那么

    request.get?

    為true,輸入相應的數據,提交為false,這樣我們可以通過一個action來控制流程
    ?
    ??def?login
    ??????
    if?request.get?
    ??????????session[:user_id]
    =nil
    ??????????@user?
    =?User.new
    ??????
    else
    ??????????@user?
    =?User.new(params[:user])
    ??????????logged_in_user?
    =?@user.try_to_login
    ??????????
    if?logged_in_user
    ??????????????session[:user_id]
    =logged_in_user.id
    ??????????????redirect_to?:action
    =>'index'
    ??????????
    else
    ??????????????flash[:notice]
    ="Invalid?user/password?combination"
    ??????????end
    ??????end
    ??end?

    posted @ 2006-05-16 10:08 martin xus| 編輯 收藏

    rails 中文亂碼的問題

    在使用rails+mysql的時候遇到了中文亂碼的問題,google了一下,解決了,把它貼出來,防止以后又忘記了

    首先在application.rb中增加utf-8的filter:

    class ?ApplicationController? < ?ActionController::Base
    ??before_filter?:configure_charsets??

    ????
    def ?configure_charsets????????
    ????? ??@headers[
    " Content-Type " ]? = ? " text/html;?charset=utf-8 " ???
    ????end
    end

    修改數據庫的編碼為utf-8

    CHARSET=utf8

    其中有一點要說明的是,我看到有人說,不能使用InnoDB,可是我測試下來的結果是,可以正常使用

    posted @ 2006-05-16 09:41 martin xus| 編輯 收藏

    僅列出標題
    共28頁: 上一頁 1 2 3 4 5 6 7 8 9 下一頁 Last 
    主站蜘蛛池模板: 国产成人精品男人免费| 好吊妞998视频免费观看在线| 亚洲熟伦熟女新五十路熟妇| 久久亚洲精品无码gv| 全免费a级毛片免费**视频| 亚洲影院天堂中文av色| 日本特黄特色免费大片| 色偷偷尼玛图亚洲综合| 亚洲人AV永久一区二区三区久久| 成人午夜免费视频| 亚洲精品中文字幕无码蜜桃| 青青草原1769久久免费播放| 91精品国产亚洲爽啪在线影院| 免费能直接在线观看黄的视频| 亚洲一区二区三区免费视频| 免费观看男人免费桶女人视频| 深夜福利在线视频免费| 亚洲乱码国产乱码精品精| 一区二区三区四区免费视频| 亚洲免费网站在线观看| 暖暖日本免费在线视频| 视频一区在线免费观看| 国产亚洲精品无码专区| 午夜视频免费在线观看| 国产精品亚洲精品青青青| 国产又长又粗又爽免费视频 | 亚洲国产一成人久久精品| 无码中文字幕av免费放dvd| 亚洲免费网站在线观看| 免费日韩在线视频| 日本在线免费观看| 亚洲精品伦理熟女国产一区二区 | 97精品免费视频| jizzjizz亚洲日本少妇| 人人狠狠综合久久亚洲婷婷| 成人免费大片免费观看网站| 免费精品国自产拍在线播放| 亚洲视频在线免费看| 免费在线不卡视频| 1000部拍拍拍18免费网站| 猫咪www免费人成网站|