From 2259328a2c8cec8dbe96968f7f627c393b81a13c Mon Sep 17 00:00:00 2001 From: Chris Moore Date: Sat, 21 May 2011 23:55:22 -0400 Subject: [PATCH] remove rails cruft and basic setup of js assets --- app/assets/javascripts/application.js | 9 - app/assets/javascripts/application.js.coffee | 2 + app/controllers/cameras_controller.rb | 2 +- app/views/cameras/index.html.erb | 1 + app/views/layouts/application.html.erb | 6 +- config/routes.rb | 2 +- public/index.html | 241 ------------------- public/javascripts/application.js | 0 8 files changed, 7 insertions(+), 256 deletions(-) delete mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/javascripts/application.js.coffee create mode 100644 app/views/cameras/index.html.erb delete mode 100644 public/index.html delete mode 100644 public/javascripts/application.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js deleted file mode 100644 index 37c7bfc..0000000 --- a/app/assets/javascripts/application.js +++ /dev/null @@ -1,9 +0,0 @@ -// This is a manifest file that'll be compiled into including all the files listed below. -// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically -// be included in the compiled file accessible from http://example.com/assets/application.js -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// the compiled file. -// -//= require jquery -//= require jquery_ujs -//= require_tree . diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee new file mode 100644 index 0000000..7393e51 --- /dev/null +++ b/app/assets/javascripts/application.js.coffee @@ -0,0 +1,2 @@ +$ -> + alert 'woop!' diff --git a/app/controllers/cameras_controller.rb b/app/controllers/cameras_controller.rb index 708b18f..bdd216a 100644 --- a/app/controllers/cameras_controller.rb +++ b/app/controllers/cameras_controller.rb @@ -1,5 +1,5 @@ class CamerasController < ApplicationController - respond_to :json + respond_to :json, :html def index @cameras = Camera.all diff --git a/app/views/cameras/index.html.erb b/app/views/cameras/index.html.erb new file mode 100644 index 0000000..8a134bf --- /dev/null +++ b/app/views/cameras/index.html.erb @@ -0,0 +1 @@ +

Hi

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 441e9be..5af4f54 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -3,12 +3,10 @@ Artimis <%= stylesheet_link_tag "application" %> - <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> - -<%= yield %> - + <%= yield %> + <%= javascript_include_tag '/assets/vendor.js', '/assets/application.js' %> diff --git a/config/routes.rb b/config/routes.rb index dace7b7..74175e0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,4 @@ -ArtimisRails::Application.routes.draw do +Artimis::Application.routes.draw do scope '/api' do scope '/v1' do resources :cameras diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 9d9811a..0000000 --- a/public/index.html +++ /dev/null @@ -1,241 +0,0 @@ - - - - Ruby on Rails: Welcome aboard - - - - -
- - -
- - - - -
-

Getting started

-

Here’s how to get rolling:

- -
    -
  1. -

    Use rails generate to create your models and controllers

    -

    To see all available options, run it without parameters.

    -
  2. - -
  3. -

    Set up a default route and remove public/index.html

    -

    Routes are set up in config/routes.rb.

    -
  4. - -
  5. -

    Create your database

    -

    Run rake db:create to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    -
  6. -
-
-
- - -
- - diff --git a/public/javascripts/application.js b/public/javascripts/application.js deleted file mode 100644 index e69de29..0000000