深入淺出RoR

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    深入淺出RoR - Presentation Transcript

    1. RoR: Ruby on Rails 2009.Apr.14 Eric
    2. Agenda • About RoR • MVC • Implement a simple web post board • Important source code • Conclusion
    3. About RoR • Based on “Ruby Programming Language” • A framework for “Agile Development”
    4. MVC Model-View-Controller
    5. Implement • Before you start the implement, you have to make sure your system environment is readay! • Ruby 1.8.6 • Rails > 2.2 • MySQL >5.0
    6. 1.Create the project > rails post Generating project files
    7. 2. Select Database Type >rails post -d <type> mysql sqlite3 postgreSQL Write the variables to database.yml
    8. 3. Configure a Database ~> cd post post> nano config/database.yml
    9. 4. Create database > rake db:create Connect to database Check the result Create successfully!
    10. 5. Generate Controller > script/generate controller home index Generate controller files automatically
    11. Test the Server > script/server http://127.0.0.1:3000/home/index Text Default Index
    12. 6. Setting the Homepage remove default index Edit config/routes.rb Add this argument
    13. 7. Scaffold script/generate scaffold Post name:string title:string content:text views views including layout models
    14. 8.Migrate > rake db:migrate Check the database Tables of database Fields in table
    15. 9. Done app/views/home/index.html.erb use the “link_to” method New index page After click Add a post
    16. 10.Test Post Successful New Back to list (show) Database Status Edit
    17. Important Source Code
    18. Database Fields Schema Support version control
    19. Interface Index page Show post New post Just using html and erb generate the view
    20. Operate index update show delete create
    21. Conclusion • Really agile • Database independent • The possibility of Ajax • Implement the web service
    SlideShare Zeitgeist 2009

    + leezhenyuleezhenyu Nominate

    custom

    158 views, 0 favs, 0 embeds more stats

    Reference: RoR Tutorial!

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 158
      • 158 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories