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
<% if micropost.to_guys == true %> | |
<li class="headshot"><%= image_tag("guys-head.png")%></li> | |
<%elsif%> | |
<li class="headshot"><%= image_tag("girl-head.png")%></li> | |
<%end%> |
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
<%= form_for @micropost do |f| %> | |
<p> | |
<fieldset> | |
<legend> What's your Tip? </legend> | |
<%= f.text_field :content, :size => 90 %> <br/> | |
<%= f.label "Send this Tip:" %> | |
<%= submit_tag "to Guys" %> | |
<%= submit_tag "to Girls"%> | |
</p> |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.1' | |
gem 'heroku' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'pg' |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.1' | |
gem 'heroku' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
group :production do |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.1' | |
gem 'heroku' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
group :production do |
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
def youtube_embed(youtube_url) | |
if youtube_url[/youtu\.be\/([^\?]*)/] | |
youtube_id = $1 | |
else | |
# Regex from # http://stackoverflow.com/questions/3452546/javascript-regex-how-to-get-youtube-video-id-from-url/4811367#4811367 | |
youtube_url[/^.*((v\/)|(embed\/)|(watch\?))\??v?=?([^\&\?]*).*/] | |
youtube_id = $5 | |
end | |
%Q{<iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/#{ youtube_id }" frameborder="0" allowfullscreen></iframe>} |
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
ruby-1.9.2-p180 :005 > Microspost.where(:id => (190..202).to_a).destroy_all) | |
SyntaxError: (irb):5: syntax error, unexpected ')', expecting $end | |
from /Users/Richardson/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in `start' | |
from /Users/Richardson/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in `start' | |
from /Users/Richardson/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.2.1/lib/rails/commands.rb:41:in `<top (required)>' | |
from script/rails:6:in `require' | |
from script/rails:6:in `<main>' | |
ruby-1.9.2-p180 :006 > Microspost.find__all | |
NameError: uninitialized constant Microspost | |
from (irb):6 |
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
<% for micropost in @microposts %> | |
<span class="article"> | |
<ul> | |
<li class="headshot"><%= image_tag("#{ micropost.to_guys ? "guys" : "girl" }-head.png") %></li> | |
<li class="tipscontent"><p><%= link_to micropost.content, page_path(micropost) %></p></li> | |
<li class="fbshare"> | |
<a href="https://twitter.com/share" class="twitter-share-button" data-via="twitterapi" data-lang="en" data-hashtags="hmdy">Tweet</a> | |
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script> |
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
$ rails new karret | |
$ rails g scaffold karretlink name link:string type:string description:string start_min:integer start_sec:integer --skip-stylesheets | |
$ rake db:migrate | |
# I made sure the page was working and displaying the scaffold then added the gems to gem file | |
$ bunddle install |
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
Installing rmagick (2.13.1) with native extensions /Users/Richardson/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) | |
/Users/Richardson/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb | |
checking for Ruby version >= 1.8.5... yes | |
checking for gcc... yes | |
checking for Magick-config... yes | |
checking for ImageMagick version >= 6.4.9... yes | |
checking for HDRI disabled version of ImageMagick... yes | |
checking for stdint.h... *** extconf.rb failed *** | |
Could not create Makefile due to some reason, probably lack of |