summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-20 17:08:14 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-04-03 22:09:33 +0200
commit595e5f9d32c9dda8f7b6c0dd5e7e4fba4693eca4 (patch)
treee2e4c5c463536b2295e722b98020ce6378482640 /app
parentedf06bf6f7d4f20d5a9145a5bbf8db409fe6ab1b (diff)
basic Ember.js setup
Diffstat (limited to 'app')
-rw-r--r--app/controllers/switchboards_controller.rb3
-rw-r--r--app/views/switchboards/app.js8
-rw-r--r--app/views/switchboards/show-old.html.haml (renamed from app/views/switchboards/show.html.haml)0
-rw-r--r--app/views/switchboards/show.html.erb23
4 files changed, 34 insertions, 0 deletions
diff --git a/app/controllers/switchboards_controller.rb b/app/controllers/switchboards_controller.rb
index 98008c1..c499c69 100644
--- a/app/controllers/switchboards_controller.rb
+++ b/app/controllers/switchboards_controller.rb
@@ -8,6 +8,9 @@ class SwitchboardsController < ApplicationController
end
def show
+ if @user.nil?
+ @user = current_user
+ end
@switchboard = @user.switchboards.find(params[:id])
@switchboard_entries = @switchboard.switchboard_entries
spread_breadcrumbs
diff --git a/app/views/switchboards/app.js b/app/views/switchboards/app.js
new file mode 100644
index 0000000..a4aa100
--- /dev/null
+++ b/app/views/switchboards/app.js
@@ -0,0 +1,8 @@
+window.App = Ember.Application.create({
+ rootElement: '#xxxyyy',
+
+ ready: function() {
+ App.view.appendTo('#xxxyyy');
+ }
+});
+
diff --git a/app/views/switchboards/show.html.haml b/app/views/switchboards/show-old.html.haml
index a825806..a825806 100644
--- a/app/views/switchboards/show.html.haml
+++ b/app/views/switchboards/show-old.html.haml
diff --git a/app/views/switchboards/show.html.erb b/app/views/switchboards/show.html.erb
new file mode 100644
index 0000000..337d00c
--- /dev/null
+++ b/app/views/switchboards/show.html.erb
@@ -0,0 +1,23 @@
+<% content_for :title, "Switchboard #{@switchboard.name}" %>
+
+<div class='row'>
+ <div class='span12'>
+ <div id='container'>
+
+ </div>
+
+ <script type="text/x-handlebars">
+ <h1>{{appName}}</h1>
+
+ <h2>{{title}}</h2>
+ </script>
+
+
+
+ </div>
+</div>
+
+<script src="/js/libs/handlebars.js"></script>
+<script src="/js/libs/ember.js"></script>
+<script src="/js/libs/ember-data.js"></script>
+<script src="/js/app.js"></script>