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

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

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

    躺在沙灘上的小豬

    快樂(lè)的每一天

    #

    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?( ).

    也就是說(shuō)當(dāng)沒(méi)有數(shù)據(jù)的時(shí)候,是get,而有數(shù)據(jù)的時(shí)候則是post.

    例如我們?cè)谟脩?hù)登錄的時(shí)候,首先轉(zhuǎn)到登錄界面,這個(gè)時(shí)候當(dāng)然還沒(méi)有數(shù)據(jù),那么

    request.get?

    為true,輸入相應(yīng)的數(shù)據(jù),提交為false,這樣我們可以通過(guò)一個(gè)action來(lái)控制流程
    ?
    ??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 中文亂碼的問(wèn)題

    在使用rails+mysql的時(shí)候遇到了中文亂碼的問(wèn)題,google了一下,解決了,把它貼出來(lái),防止以后又忘記了

    首先在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

    修改數(shù)據(jù)庫(kù)的編碼為utf-8

    CHARSET=utf8

    其中有一點(diǎn)要說(shuō)明的是,我看到有人說(shuō),不能使用InnoDB,可是我測(cè)試下來(lái)的結(jié)果是,可以正常使用

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

    僅列出標(biāo)題
    共28頁(yè): 上一頁(yè) 1 2 3 4 5 6 7 8 9 下一頁(yè) Last 
    主站蜘蛛池模板: 在线精品亚洲一区二区小说| 亚洲成?Ⅴ人在线观看无码| 久久久久亚洲av无码尤物| 久久www免费人成精品香蕉| 全亚洲最新黄色特级网站 | 成人免费一区二区三区| 亚洲人成电影网站国产精品 | 午夜国产精品免费观看| 久久亚洲日韩看片无码| 日韩免费高清大片在线| 亚洲一区免费视频| 性色av免费观看| 国产成人+综合亚洲+天堂| 亚洲精品久久久www| 中国一级毛片免费看视频| 亚洲国产精品无码AAA片| 无码人妻一区二区三区免费看| 亚洲AV日韩AV天堂一区二区三区| 日韩在线不卡免费视频一区| 亚洲成人网在线播放| 在线jlzzjlzz免费播放| 日韩亚洲人成网站| 国产亚洲美女精品久久久2020 | 国产亚洲成av人片在线观看| 99re在线视频免费观看| 中文字幕亚洲精品无码| 免费A级毛片无码A| 精品一区二区三区免费| 亚洲熟妇无码久久精品| 暖暖日本免费在线视频| eeuss影院ss奇兵免费com| 老汉色老汉首页a亚洲| 在线免费观看毛片网站| 国产免费久久久久久无码| 久久精品国产亚洲AV嫖农村妇女 | 免费A级毛片无码A∨免费| 久久精品国产亚洲av天美18| 国产成A人亚洲精V品无码| 女人让男人免费桶爽30分钟| v片免费在线观看| 亚洲国产成人超福利久久精品|