# 'users' is whatever table you need to fix.
# http://stackoverflow.com/questions/13670235/after-importing-data-in-postgresql-duplicate-key-value-violates-unique-constrai
ActiveRecord::Base.connection.reset_pk_sequence!('users')
This file contains hidden or 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
# app/models/post.rb | |
class Post < ActiveRecord::Base | |
has_many :tags, dependent: :destroy | |
# Enable the building of complex forms | |
accepts_nested_attributes_for :tags, allow_destroy: true | |
end |
We start by getting devise up and running and generating the User model.
rails generate devise User
Then you'll probably run rake db:migrate
and follow their instructions for making sure you have a few default things in order. Okay, so far so good.
- Go to Google Docs and create your spreadsheet
- Give column names and make note of them as they become the names of your input fields
- Give the spreadsheet the tab name of "DATA"
- Click Tools > Script Editor
- Choose 'Spreadsheet' under 'Create Script for'
This file contains hidden or 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
//Define the colums we want to see in the work view | |
add_filter("manage_edit-work_columns", "work_edit_columns"); | |
function work_edit_columns($columns) | |
{ | |
$columns = array( | |
"cb" => "<input type=\"checkbox\" />", | |
"title" => "Project", | |
"client" => "Client", | |
"disciplines" => "Disciplines", | |
"comments" => "<img alt='Comments' src='http://matthaliski.com/wp-admin/images/comment-grey-bubble.png'>", |
This file contains hidden or 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
//It's a good idea to listen for the stage before you attempt to access it | |
if (stage) { | |
init(); | |
} else { | |
addEventListener(Event.ADDED_TO_STAGE, init, false, 0, true); | |
} |
This file contains hidden or 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
//There is no need to hook up to a pointless FLA in larger projects. Just define your swf properties like this | |
//Included in the Document Class within the package. | |
[SWF(width='160',height='600',backgroundColor='#000000',frameRate='24')] | |