-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:thogg4/classie
Conflicts: .gitignore Rakefile app/controllers/admin_controller.rb app/controllers/ads_controller.rb app/controllers/application_controller.rb app/controllers/cats_controller.rb app/controllers/sessions_controller.rb app/controllers/sub_cats_controller.rb app/controllers/users_controller.rb app/helpers/application_helper.rb app/models/ad.rb app/models/asset.rb app/models/cat.rb app/models/user.rb config/boot.rb config/environment.rb config/environments/development.rb config/environments/production.rb config/environments/test.rb config/initializers/backtrace_silencers.rb config/initializers/inflections.rb config/initializers/session_store.rb config/locales/en.yml config/routes.rb db/schema.rb db/seeds.rb public/404.html public/422.html public/500.html test/fixtures/ads.yml test/fixtures/cats.yml test/fixtures/users.yml
- Loading branch information
Showing
192 changed files
with
6,047 additions
and
0 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This is a simple classified ads application. Feel free to use it however you want. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
<<<<<<< HEAD | ||
#!/usr/bin/env rake | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require File.expand_path('../config/application', __FILE__) | ||
|
||
Classie::Application.load_tasks | ||
======= | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require(File.join(File.dirname(__FILE__), 'config', 'boot')) | ||
|
||
require 'rake' | ||
require 'rake/testtask' | ||
require 'rake/rdoctask' | ||
|
||
require 'tasks/rails' | ||
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed |
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
<<<<<<< HEAD | ||
class ApplicationController < ActionController::Base | ||
protect_from_forgery | ||
======= | ||
# Filters added to this controller apply to all controllers in the application. | ||
# Likewise, all the methods added will be available for all controllers. | ||
|
||
class ApplicationController < ActionController::Base | ||
helper :all # include all helpers, all the time | ||
protect_from_forgery # See ActionController::RequestForgeryProtection for details | ||
|
||
include AuthenticatedSystem | ||
|
||
# Scrub sensitive parameters from your log | ||
# filter_parameter_logging :password | ||
|
||
def get_ad_id | ||
@ad = Ad.find(params[:ad_id]) | ||
end | ||
|
||
>>>>>>> d4a4f1bcc942c20df1b86ac333158c9e7d25fbed | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
class AssetsController < ApplicationController | ||
|
||
before_filter :get_ad_id, :except => "show" | ||
|
||
def index | ||
@assets = Asset.all | ||
end | ||
|
||
|
||
|
||
#show is my photo viewer page | ||
def show | ||
@image = params[:image] | ||
render :layout => "bare" | ||
end | ||
|
||
|
||
|
||
|
||
def new | ||
@asset = Asset.new | ||
@ad = Ad.find(params[:ad_id]) | ||
@assets = @ad.assets | ||
end | ||
|
||
def create | ||
@asset = Asset.new(params[:asset]) | ||
@asset.ad_id = @ad.id | ||
if @asset.save | ||
if params[:commit] == "Add" | ||
flash[:notice] = "Photo added" | ||
redirect_to(edit_user_ad_path(current_user, @ad)) | ||
else | ||
flash[:notice] = "Photo added" | ||
redirect_to(new_user_ad_asset_path(current_user, @ad)) | ||
end | ||
else | ||
render :action => 'new' | ||
end | ||
end | ||
|
||
def edit | ||
@asset = Asset.find(params[:id]) | ||
end | ||
|
||
def update | ||
@ad = Ad.find(params[:ad_id]) | ||
@asset = Asset.find(params[:id]) | ||
if @asset.update_attributes(params[:asset]) | ||
flash[:notice] = "Successfully updated asset." | ||
redirect_to(edit_user_ad_path(current_user, @ad)) | ||
else | ||
render :action => 'edit' | ||
end | ||
end | ||
|
||
def destroy | ||
@asset = Asset.find(params[:id]) | ||
@asset.destroy | ||
flash[:notice] = "Photo deleted" | ||
redirect_to(edit_user_ad_path(current_user, @ad)) | ||
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
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module AdminHelper | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module AdsHelper | ||
end |
Oops, something went wrong.