This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scope "/:vanity_url" do | |
resources :companies, :path => '/clients' do | |
resources :service_records | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='new-category'> | |
<h4>Add a new category</h4> | |
<div id="error-space"></div> | |
<%= form_for([@account.vanity_url, @new_category]) do |cat| %> | |
<%= cat.text_field :name %> | |
<%= cat.submit %> | |
<% end -%> | |
<%= link_to "Close", "#", :id => "close" %> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Account < ActiveRecord::Base | |
belongs_to :package | |
has_many :users | |
has_many :clients | |
has_many :items | |
has_many :attributes | |
has_many :notes | |
accepts_nested_attributes_for :users | |
accepts_nested_attributes_for :clients | |
accepts_nested_attributes_for :attributes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Account < ActiveRecord::Base | |
has_many :users | |
authenticates_many :user_sessions, :scope_cookies => true | |
# Other code by you | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserSessionsController < ApplicationController | |
def new | |
@user_session = current_account.user_sessions.build | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
helper_method :current_account, :current_user # you may have others that go here too | |
private | |
# I added this so that way I can just use current_account just like current_user | |
def current_account | |
@current_account = Account.find_by_subdomain(request.subdomain) | |
return @current_account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
helper_method :current_account, :current_user # you may have others that go here too | |
private | |
# I added this so that way I can just use current_account just like current_user | |
def current_account | |
@current_account = Account.find_by_subdomain(request.subdomain) | |
return @current_account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%-- This block checks the number of items in a contentloop | |
---------------------------------------------------------------------------------- --%> | |
<cms:contentaccess var="content" scope="page" /> | |
<c:set var="count" value="${fn:length(content.valueList['Bottom'])}" /> | |
<%-- End the check | |
----------------------------------------------------------------------------------- --%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku config:add DATABASE_URL=mysql2://username:password@ip.goes.here/data_base_name --app heroku-app-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateAttributes < ActiveRecord::Migration | |
def change | |
end | |
end |
OlderNewer