<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中文字幕| 国产精品免费观看| 亚洲精品视频观看| 91热成人精品国产免费| 亚洲无限乱码一二三四区| 国产男女爽爽爽爽爽免费视频 | www.亚洲色图.com| 美女尿口扒开图片免费 | 福利免费观看午夜体检区| 亚洲午夜精品一区二区公牛电影院| 99re6在线视频精品免费下载 | 亚洲综合成人婷婷五月网址| 中文字幕无码视频手机免费看| 亚洲 日韩经典 中文字幕| 老司机永久免费网站在线观看| 亚洲av无码日韩av无码网站冲| www国产亚洲精品久久久日本| g0g0人体全免费高清大胆视频| 国产亚洲美女精品久久久久狼| 国产好大好硬好爽免费不卡| 亚洲性一级理论片在线观看| 成人激情免费视频| 爱情岛论坛免费视频| 国产v亚洲v天堂无码网站| 91精品国产免费入口| 亚洲av成人综合网| 国产猛烈高潮尖叫视频免费| 久久国产乱子伦精品免费午夜| 亚洲国产精品lv| 妞干网在线免费观看| 黄视频在线观看免费| 亚洲精品日韩专区silk| 日本一道一区二区免费看 | 中文字幕亚洲一区| 四虎在线免费视频| 色屁屁www影院免费观看视频| 亚洲国产精品无码久久久不卡|