Skip to content

Commit

Permalink
removing DB/broken cruft, switching to more ujs-style
Browse files Browse the repository at this point in the history
  • Loading branch information
themgt committed Mar 11, 2013
1 parent 004310e commit 71ccbd6
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 52 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ruby '2.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0.beta1'

gem 'pg'
gem 'thin'
gem 'websocket-rails', git: 'git://github.com/DanKnox/websocket-rails.git'

Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ GEM
mime-types (1.21)
minitest (4.6.2)
multi_json (1.6.1)
pg (0.14.1)
polyglot (0.3.3)
rack (1.5.2)
rack-test (0.6.2)
Expand Down Expand Up @@ -147,7 +146,6 @@ DEPENDENCIES
coffee-rails (~> 4.0.0.beta1)
jquery-rails
less-rails
pg
rails (= 4.0.0.beta1)
sass-rails (~> 4.0.0.beta1)
therubyracer
Expand Down
14 changes: 5 additions & 9 deletions app/assets/javascripts/chat.js.coffee
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
jQuery ->
window.chatController = new Chat.Controller($('#chat').data('uri'), true);

window.Chat = {}

class Chat.User

constructor: (@user_name) ->

serialize: =>
{
user_name: @user_name
}
serialize: => { user_name: @user_name }

class Chat.Controller

template: (message) ->
html =
"""
Expand Down Expand Up @@ -76,5 +73,4 @@ class Chat.Controller
@user = new Chat.User("Guest_" + rand_num)
$('#username').html @user.user_name
$('input#user_name').val @user.user_name
@dispatcher.trigger 'new_user', @user.serialize()

@dispatcher.trigger 'new_user', @user.serialize()
6 changes: 0 additions & 6 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
}
</style>
<%= stylesheet_link_tag "application", :media => "all" %>

<!-- Le fav and touch icons -->
<link href="images/favicon.ico" rel="shortcut icon">
<link href="images/apple-touch-icon.png" rel="apple-touch-icon">
<link href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon" sizes="72x72">
<link href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon" sizes="114x114">
<%= javascript_include_tag "application" %>

</head>
Expand Down
9 changes: 2 additions & 7 deletions app/views/public/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="chat" class="well">
<div id="chat" class="well" data-uri="<%= request.host %>:<%= request.port %>/websocket">
</div>

<div class="form-inline well">
Expand All @@ -7,9 +7,4 @@
<input type="text" class="input-xlarge" id="message">
<button id="send" class="btn btn-primary">Send</button>
</fieldset>
</div>
<%= javascript_tag do %>
jQuery(function() {
window.chatController = new Chat.Controller("<%= request.host %>:<%= request.port %>/websocket",true);
})
<% end %>
</div>
6 changes: 5 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require File.expand_path('../boot', __FILE__)

require 'rails/all'
# require 'rails/all'
require "action_controller/railtie"
require "action_mailer/railtie"
require "rails/test_unit/railtie"
require "sprockets/railtie"

# Assets should be precompiled for production (so we don't need the gems loaded then)
Bundler.require(*Rails.groups(assets: %w(development test)))
Expand Down
25 changes: 0 additions & 25 deletions config/database.yml

This file was deleted.

2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
config.active_support.deprecation = :log

# Raise an error on page load if there are pending migrations
config.active_record.migration_error = :page_load
# config.active_record.migration_error = :page_load

# Debug mode disables concatenation and preprocessing of assets.
config.assets.debug = true
Expand Down

0 comments on commit 71ccbd6

Please sign in to comment.