All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rails-resources.src.main.webapp.index.html Maven / Gradle / Ivy

There is a newer version: 3.0.5
Show newest version
#set( $symbol_dollar = '$' )


  
    Ruby on Rails: Welcome aboard
    
    
    
    
  
  
    

Getting started

Here’s how to get rolling:

  1. Use mvn rails${railsVersion.substring(0,1)}:generate to create your models and controllers

    To see all available options, run it without parameters.

    example:
    mvn rails${railsVersion.substring(0,1)}:generate -Dargs="scaffold user name:string"

  2. Set up a default route and remove or rename this file

    Routes are set up in config/routes.rb.

  3. Create your database

    mvn rails${railsVersion.substring(0,1)}:rake -Dargs="db:create db:migrate"
    will to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    For production use mvn rails${railsVersion.substring(0,1)}:rake -Dargs="db:create db:migrate" -Drails.env=production

  4. Start embedded servlet-engine

    Run mvn jetty:run and find the generated users resource here - jetty runs on port 8080 !

    For production mvn jetty:run -Drails.env=production

  5. Start default ruby server (webrick)

    mvn rails${railsVersion.substring(0,1)}:server

    Find the users resource here - webrick runs on port 3000 !

    For production mvn rails${railsVersion.substring(0,1)}:server -Drails.env=production

  6. Package your war file

    mvn package -Drails.env=production will produce a war file for production in the directory target.

    run jetty with the production warfile
    mvn jetty:run-war -Drails.env=production

  7. Running the tests or specs

    mvn -Drails.env=test

    after migrating the new tables with
    mvn rails3:rake -Dargs=db:migrate -Drails.env=test

  8. More help for maven goals

    mvn rails${railsVersion.substring(0,1)}:help for rails specific goals.

    mvn gem:help for rubygems specific goals.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy