Showing posts with label csv. Show all posts
Showing posts with label csv. Show all posts

Saturday, 8 February 2014

WDI Progress Update - Trendmyhunch Project Launched, Feedback forms, 'What The Trend API', 'Google Visualization API', CSV to PSQL, Example Code

Challenges:
  • Homework:  Email Production using SendGrid and ActionMailer, Feedback form (using Get Satisfaction, UserVoice), Review Github Code of other students 
  • Want to Try: Redcarpet, Javascript tutorials
  • Example Code #1 (using 'trends.format' JSON hash from What The Trend API):
              Testing Method: Pry
              Try it on My Website: Trendmyhunch (beta only so follow the instructions carefully!)

          New Method inside IdeasController.rb
          Modify Sample Google Visualization API code (obtained here)
         
          Please email me if interested..
  • Example Code #2 (loading contents of .CSV files into PSQL database):
         Please email me if interested...

Progress @ General Assembly (GA):


Contributions to Developer Community 

Wednesday, 5 February 2014

WDI Progress Update - Production, Bootstrap, CSV migrations

Challenges:
  • App exploded when tried to install bootstrap, used Heroku clone to recover
  • Searching databases and filtering selections
  • Resolved absolute file paths not being recognised when uploading to Heroku. Fixed data migration files and relocated CSV files to the root directory. Compiled successfully with this code:
require 'fileutils'require 'csv' 
class AddIdeaData < ActiveRecord::Migration
  def up
filepath = Rails.root.join("ideas.csv")
# locate the csv file in your /public folder if File.exist?(filepath) CSV.foreach(filepath)do |col| Idea.create(:name => col[0].to_s, :description => col[1].to_s, :author => col[6].to_s, :url => col[7].to_s, :country => col[8].to_s) end else  raise "No file exists with name: #{filepath}" end  end
  def down   Idea.all.destroy # only with team permission  end
end

                                                Progress @ General Assembly (GA):
                                                • Rails (Authentication vs Authorisation, Static page controller, Custom controller methods using routing collections and members, Hidden form fields)
                                                • Production (Heroku)
                                                • Gems (Sanitise for customising Devise Authentication, Rails_12factor for production and images on Heroku)
                                                • Agile (Daily Scrum meetings)
                                                • Bootstrap themes


                                                Contributions to Developer Community 
                                                • Exciting ideas and concepts explored with the The Slippery Gypseas!
                                                • Sydney Tech Startup Meetup on 6th Feb

                                                Curious:
                                                • Cancan (Authorisation)