`
wutao8818
  • 浏览: 612580 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Practical.REST.on.Rails.2.Projects笔记

    博客分类:
  • ruby
阅读更多
引用
Apress.Practical.REST.on.Rails.2.Projects.Apr.2008.pdf

In any application I intend to deploy to a production environment, I generally install the
exception_notification plugin at about this point. Exception_notification modifies your application so that
any unhandled exceptions in production automatically generate an email to whomever you specify, helping
you to keep track of problems as they occur.

you can install it by running this command:
ruby script/plugin install
http://dev.rubyonrails.org/svn/rails/plugins/exception_notification/

restful_authentication

引用
Since restful_authentication was originally released, the best practices of RESTful Rails development
have diverged a bit from those illustrated in the plugin—and as of today, it is still being updated to
reflect the new trends. As such, it’s not a perfect model for the whole of the MovieList application, but it provides
an excellent starting point and is not so different that it is harmful.


ruby script/plugin install http://svn.techno-weenie.net/projects/plugins/restful_authentication
ruby script/generate authenticated user sessions

DEBUG
--------------------------------------------------------------------
Page 41 发现一个问题
Go ahead and create a new user here 当我用safari发送一个创建新用户请求的时候提示
引用
ActionController::InvalidAuthenticityToken
找了一下发现处理方法在 rubyonrails api中有
原地址:http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection/ClassMethods.html

引用

  # Disable request forgery protection in test environment
  config.action_controller.allow_forgery_protection = false


 class FooController < ApplicationController
    # uses the cookie session store (then you don't need a separate :secret)
    protect_from_forgery :except => :index

    # uses one of the other session stores that uses a session_id value.
    protect_from_forgery :secret => 'my-little-pony', :except => :index

    # you can disable csrf protection on controller-by-controller basis:
    skip_before_filter :verify_authenticity_token
  end

--------------------------------------------------------------------
Page 63修改首页
map.root :controller => 'movies',:action => 'index' 
这样修改首页还没变,原来还要删除public/index.html在route.rb中写了说明
引用
  # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
  # map.root :controller => "welcome"
分享到:
评论

相关推荐

    Apress.Practical.Ruby.Projects.Dec.2007.eBook-BBL.rar

    《Apress.Practical.Ruby.Projects.Dec.2007.eBook-BBL.rar》是一部关于Ruby编程语言实践项目的电子书,由Apress出版社在2007年12月出版。这本书面向的是对Ruby编程有一定基础,希望进一步提升实战技能的开发者。...

    Apress - Practical Rails Projects (Oct 2007)

    附带的源代码文件(Apress - Practical Rails Projects (SourceCode).7z)提供了书中实例项目的完整源代码,这将是你动手实践、加深理解的重要资源。你可以跟随书中的步骤操作,或者独立探索,通过实际编码来巩固所...

    Ruby_On_Rails笔记

    综上所述,Ruby on Rails的笔记内容涵盖了从安装Rails环境到创建和运行一个简单的Rails项目的基础知识,这些内容对于初学者来说是学习Rails框架的极好入门材料。通过对这些知识点的学习,初学者可以快速了解Rails的...

    Building.Dynamic.Web.2.0.Websites.with.Ruby.on.Rails

    《构建动态Web 2..0网站:使用Ruby on Rails》不仅是一本介绍Ruby on Rails基础知识的书籍,更是一部深入探讨Web 2.0时代下如何利用这一强大框架构建高效、安全、高性能的动态网站的实用指南。对于希望学习或深化...

    Ruby-on-Rails-rails.zip

    Ruby_on_Rails_rails.zip Ruby_on_Rails_rails.zip Ruby_on_Rails_rails.zip Ruby_on_Rails_rails.zipRuby_on_Rails_rails.zip Ruby_on_Rails_rails.zip Ruby_on_Rails_rails.zip Ruby_on_Rails_rails.zipRuby_on_...

    Apress.Practical.Rails.Social.Networking.Sites.Jun.2007.eBook-BBL.pdf

    - **定义**:Ruby on Rails(简称Rails)是一种用于快速开发Web应用程序的开源Web框架。 - **特点**: - 遵循模型-视图-控制器(Model-View-Controller, MVC)架构模式。 - 强调“约定优于配置”,简化了开发过程...

    Wrox.Professional.Ruby.on.Rails.Feb.2008

    《Wrox Professional Ruby on Rails Feb 2008》是一本专门为想...压缩包中的文件名称“Wrox.Professional.Ruby.on.Rails.Feb.2008.pdf”正是这本书的电子版,包含了所有你需要的知识点,是学习RoR不可多得的参考资料。

    Ruby.on.Rails.Web.Mashup.Projects

    ### Ruby on Rails Web Mashup Projects #### 知识点概览 - **Web Mashup**:结合了多种网络服务的数据或功能,以提供新的、增强的用户体验。 - **Ruby on Rails (RoR)**:一种开源的Web应用框架,遵循Model-View-...

    Wrox.Professional.Ruby.on.Rails.Feb.2008.pdf

    《Wrox Professional Ruby on Rails Feb 2008》是一本深入探讨Ruby on Rails框架的专业书籍,出版于2008年2月。Ruby on Rails(简称Rails)是由David Heinemeier Hansson创建的一个开源Web应用程序框架,它遵循模型-...

    Addison.Wesley.Rails.AntiPatterns.Best.Practice.Ruby.on.Rails.Refactoring

    《Rails反模式:最佳实践与Ruby on Rails重构》是一本由Chad Pytel和Tammer Saleh撰写的书籍,深入探讨了在Ruby on Rails开发过程中常见的反模式,并提供了相应的最佳实践和重构策略。本书旨在帮助开发者识别并避免...

    Addison.Wesley.RailsSpace.Building.a.Social.Networking.Website.with.Ruby.on.Rails

    ### Addison.Wesley.RailsSpace:使用Ruby on Rails构建社交网络网站 #### 一、引言 《RailsSpace:使用Ruby on Rails构建社交网络网站》是一本由Michael Hartl和Aurelius Prochazka共同撰写的书籍。本书旨在通过...

    Build.Your.Own.Ruby.on.Rails.Web.Applications.Feb.2007.pdf

    《构建你自己的Ruby on Rails Web应用》一书由Patrick Lenz撰写,于2007年出版,由SitePoint Pty Ltd.发行。本书是针对希望使用Ruby on Rails框架开发Web应用的初学者和中级开发者的一份详尽指南。以下是根据书籍...

    Rails.Angular.Postgres.and.Bootstrap.2nd.Edition

    You'll learn how to install Postgres on your computer or use a free version of it in the cloud. Table of Contents Chapter 1. Set Up the Environment Chapter 2. Create a Great-Looking Login with ...

    Rails上的API:使用Rails构建REST APIAPIs on Rails: Building REST APIs with Rails

    在本篇内容中,我们将深入探讨如何利用Ruby on Rails(简称Rails)这一强大的Web应用程序框架来构建可伸缩且易于维护的RESTful API。Rails以其简洁优雅的语法、高效的开发速度以及良好的社区支持而闻名,这使得它...

    Apress - Practical JRuby on Rails Web 2.0 Projects (Sep 2007)

    《JRuby on Rails Web 2.0 实用项目》 英文PDF + 源码

    Wiley.Ruby.on.Rails.Bible.Oct.2008

    根据提供的文件信息,“Wiley.Ruby.on.Rails.Bible.Oct.2008”这本书主要涉及Ruby on Rails的相关知识和技术。以下是对该书标题、描述以及部分内容中的关键知识点进行的详细解读: ### 标题:“Wiley.Ruby.on.Rails...

    Web.Services.on.Rails.

    《Web.Services.on.Rails》是一本专注于在Rails...同时,提供的`OReilly.Web.Services.on.Rails.May.2006.chm`文件可能包含了详细的技术讲解和实例,而`bookant.url`可能是书籍的在线资源链接,供读者深入学习和查阅。

    Ruby.on.Rails.Web开发之旅2

    Ruby.on.RaRuby.on.Rails.Web开发之旅

Global site tag (gtag.js) - Google Analytics