Permalink
Browse files

View now outputs safe html. View helper working in demo app.

  • Loading branch information...
1 parent a84252d commit 19ba83876643ecf68b7ff5fbcf16b3242f26972a @aantix committed Nov 26, 2010
@@ -1 +0,0 @@
-Autotest.add_discovery { "rspec2" }
@@ -1,13 +0,0 @@
-class SexItUpGenerator < Rails::Generator::NameBase
-
- def manifest
- record do |m|
- m.migration_template "sex_it_up_migration.rb.erb", File.join('db', 'migrate'), :migration_file_name => 'create_sex_it_up_images'
- end
- end
-
- def banner
- %{Usage: #{$0} #{spec.name}\nCopies needed migrations to project.}
- end
-
-end
@@ -1,20 +0,0 @@
-class CreateSexItUp < ActiveRecord::Migration
- def self.up
- #load(File.dirname(__FILE__) + '/../../../spec/schema.rb')
- create_table "sex_it_up_images" do |t|
- t.string :image_search_term
- t.string :image_original_url
- t.string :image_url
- t.string :image_file_name
- t.string :image_content_type
- t.integer :image_file_size
- t.datetime :image_updated_at
- end
-
- end
-
- def self.down
- drop_table :sex_it_up_images
- end
-
-end
@@ -0,0 +1,26 @@
+require 'rails/generators'
+require 'rails/generators/migration'
+
+class SexItUpGenerator < Rails::Generators::Base
+ include Rails::Generators::Migration
+
+ #source_root = File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
+ def self.source_root
+ @source_root ||= File.join(File.dirname(__FILE__), 'templates')
+ end
+
+ def generate_migration
+ migration_template "sex_it_up_migration.rb", "db/migrate/create_sex_it_up_images.rb"
+ end
+
+ protected
+
+ def self.next_migration_number(dirname)
+ if ActiveRecord::Base.timestamped_migrations
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
+ else
+ "%.3d" % (current_migration_number(dirname) + 1)
+ end
+ end
+
+end
@@ -0,0 +1,22 @@
+require 'sex_it_up'
+
+class CreateSexItUpImages < ActiveRecord::Migration
+ def self.up
+ #load(File.dirname(__FILE__) + '/../../../spec/schema.rb')
+ create_table "sex_it_up_images" do |t|
+ t.string :image_search_term
+ t.string :image_original_url
+ t.string :image_url
+ t.string :image_file_name
+ t.string :image_content_type
+ t.integer :image_file_size
+ t.datetime :image_updated_at
+ end
+
+ end
+
+ def self.down
+ drop_table :sex_it_up_images
+ end
+
+end
View
@@ -121,7 +121,7 @@ def sexy_image(term, opts = {:width => 100, :height => 100})
tag += " title=\"#{opts[:title]}\"" if opts[:title]
tag += " />"
- return tag
+ return tag.html_safe
end
nil
View
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jim Jones"]
- s.date = %q{2010-11-24}
+ s.date = %q{2010-11-26}
s.description = %q{SexItUp allows for the easy drop-in of public domain images for site mockups and user avatars.}
s.email = %q{jjones@aantix.com}
s.extra_rdoc_files = [
@@ -18,8 +18,8 @@ Gem::Specification.new do |s|
]
s.files = [
"Rakefile",
- "generators/sex_it_up/sex_it_up_generator.rb",
- "generators/sex_it_up/templates/sex_it_up_migration.rb.erb",
+ "lib/generators/sex_it_up/sex_it_up_generator.rb",
+ "lib/generators/sex_it_up/templates/sex_it_up_migration.rb",
"lib/sex_it_up.rb",
"lib/tasks/sex_it_up.rb",
"spec/factories/Plato_and_Aristotle_in_The_School_of_Athens,_by_italian_Rafael.jpg",

0 comments on commit 19ba838

Please sign in to comment.