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
def create | |
@gallery = Gallery.find(params[:gallery_id]) | |
@photo = @gallery.photos.new(:swfupload_file => params[:Filedata]) | |
if @photo.save | |
render :partial => 'image', :object => @photo | |
else | |
render :text => "error" | |
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
<div class="message"> | |
Add photos to <%= @gallery.name %> | |
</div> | |
<div class="buttons"> | |
<button id="browse" class="browse">Browse</button> | |
<button id="upload" class="upload">Upload Files</button> | |
<div id="btnPlaceHolder"></div> | |
</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
<% div_for(image) do -%> | |
<%= link_to image_tag(image.image.url(:medium), :class => 'thumb'), image.image.url(:large) %> | |
<p> | |
<%= link_to_remote 'Delete', :url => image, :html => { :class => 'lnk-del' }, :confirm => 'You cannot undo this. Are you sure?', :method => :delete %> | |
</p> | |
<% 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
<%= stylesheet_link_tag 'swfupload' %> | |
<script src="http://www.google.com/jsapi"></script> | |
<script> | |
google.load('jquery','1.3.2'); | |
</script> | |
<%= javascript_include_tag 'swfupload', 'upload' %> | |
<script> | |
var swfu; | |
// Dom Ready |
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
script/generate scaffold gallery title:string |
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 User | |
#... | |
def before_create | |
uid = OAuth.prepare_user(???).uid #??? | |
return true if not User.find_by_uid(uid) | |
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
Feature: Books | |
So that I can add books | |
With due dates | |
The system will allow me to | |
Create and manage a list of books | |
So I can get reminders before they're due back | |
Scenario: Create a book |
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
<style type="text/css"> | |
#myDiv{ | |
padding-top:10px; | |
background:url(/images/brushline.gif) repeat-x; | |
} | |
</style> | |
<div id="myDiv"> | |
<p>Hello, World!</p> | |
</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
When /^I add a new booking with:$/ do |table| | |
booking_info = table.hashes.first | |
visit new_booking_path | |
booking_info.each do |field, value| | |
if field == 'Start Date' || field == 'End Date' | |
fill_in(field, :with => value) | |
elsif field != 'Contractors' | |
select(value, :from => field) | |
else |
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
INSERT INTO "attachments" ("attachment_file_name", "created_at", "attachment_content_type", "attachment_file_size", "updated_at", "attachable_type", "attachable_id", "attachment_updated_at") VALUES(NULL, '2010-02-17 17:40:08', NULL, NULL, '2010-02-17 17:40:08', 'Booking', 11, NULL) |