Skip to content

Instantly share code, notes, and snippets.

View shwoodard's full-sized avatar

Sam Woodard shwoodard

View GitHub Profile
Umbrella.ShowProjectView = Ember.ContainerView.extend
classNames: ['projects_show', 'row']
contentBinding: 'controller'
childViews: ['projectImagesIndexView']
projectImagesIndexView: Ember.ContainerView.create
contentBinding: 'controller.projectImages'
childViews:[Umbrella.ProjectSlideshowView.create()]
Umbrella.Router = Ember.Router.extend
enableLogging: true
root: Ember.Route.extend
index: Ember.Route.extend
route: '/'
redirectsTo: 'projects'
projects: Ember.Route.extend
Umbrella.NewProjectDiscussionView = Ember.View.extend
contentBinding: 'controller'
tagName: 'form'
templateName: 'project_discussions/new'
submit: ->
Umbrella.store.createRecord Umbrella.ProjectDiscussion,
body: this.get('body')
project: this.get('content').objectAt('0').get('project')
Umbrella.store.commit()
Umbrella.ProjectSlideshowView = Ember.CollectionView.extend
tagName: 'ol'
contentBinding: 'controller'
classNames: ['project_carousel']
itemViewClass: Ember.View.extend
templateName: 'projects/slideshow'
Umbrella.router = Ember.Router.create({
root: Ember.State.extend({
setupControllers: function (router) {
alert('bang')
}
})
});
Umbrella.initialize(Umbrella.router);
@shwoodard
shwoodard / gist:2492041
Created April 25, 2012 18:36 — forked from thommahoney/gist:2491946
RailsConf 2012 Lightning Talks
1 min:
~Painless Javascript
koting hatduklgg
with wind tunnel
~tenderlove.dup jremsikjr
~iwanttolearnruby.com
(collecting resources for learning ruby)
git clone git@github.com:shwoodard/facebox-rails.git
cd facebox-rails
bundle
rspec
rm -rf app/assets
rspec
(should fail)
# pseudo code
MyApplication.routes do
resources :orders do
resource :products do
end
end
end
diff --git a/app/controllers/business/pages_controller.rb b/app/controllers/business/pages_controller.rb
index cd23804..ae4b805 100644
--- a/app/controllers/business/pages_controller.rb
+++ b/app/controllers/business/pages_controller.rb
@@ -33,6 +33,7 @@ class Business::PagesController < Business::BusinessController
end
def edit
+ @social_app = SocialApp.default_app unless @page.published?
if params[:iframe]
def get_descriptor(descriptor, descriptor_keys = Rails.env, i = 0)
if descriptor.is_a?(Array) || descriptor.is_a?(String)
descriptor
elsif descriptor.is_a?(Hash)
if descriptor_keys.is_a?(Array)
get_descriptor(descriptor[descriptor_keys[i]], descriptor_keys, i + 1)
else
descriptor[descriptor_keys]
end
end