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
<ul class="ortho-in-motion cf"><?php | |
$i = 0; | |
$number_of_posts_output = 0; | |
$number_of_posts_output_by_doctor = 0; | |
$length_of_xml = count($xml->channel); //I forget how to do this | |
foreach ($xml->channel->item as $entry){ | |
$i++; | |
if (author_of_this_post_is_current_doctor()) { | |
echo "<li>post</li>"; |
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
michael-hopkinss-macbook-pro:grbc Michael$ git push heroku master | |
Counting objects: 90, done. | |
Delta compression using up to 2 threads. | |
Compressing objects: 100% (60/60), done. | |
Writing objects: 100% (60/60), 9.10 KiB, done. | |
Total 60 (delta 38), reused 0 (delta 0) | |
-----> Heroku receiving push | |
-----> Ruby/Rails app detected | |
-----> Installing dependencies using Bundler version 1.1.rc.7 |
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
ruby-1.9.2-p290 :056 > Sermon.where("date > ?", Date.today - 365).select(:speaker_id).uniq | |
Sermon Load (0.5ms) SELECT speaker_id FROM "sermons" WHERE (date > '2011-02-07') | |
=> [#<Sermon speaker_id: 1>, #<Sermon speaker_id: 1>, #<Sermon speaker_id: 1>, #<Sermon speaker_id: 1>, #<Sermon speaker_id: 1>] | |
Update: answer: | |
ruby-1.9.2-p290 :070 > Sermon.select(:speaker_id).where("date > ?", Date.today - 365).group(:speaker_id) | |
Sermon Load (0.5ms) SELECT speaker_id FROM "sermons" WHERE (date > '2011-02-07') GROUP BY speaker_id | |
=> [#<Sermon speaker_id: 1>] |
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
irb(main):032:0> s.date = "11/9/2007" | |
=> "11/9/2007" | |
irb(main):033:0> s.date | |
=> Tue, 11 Sep 2007 00:00:00 UTC +00:00 | |
irb(main):034:0> s.date = "2007/11/9" | |
=> "2007/11/9" | |
irb(main):035:0> s.date | |
=> Fri, 09 Nov 2007 00:00:00 UTC +00:00 | |
irb(main):036:0> |
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
$(document).ready -> | |
$('#menu li a').hover -> | |
$(this).animate({backgroundColor:'#7c9344'},'fast') | |
$(this).animate({backgroundColor:'#f6fcfc'},'fast') |
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
application.html.erb: | |
<%= generate_menu_link do %> <%= link_to "Home", :controller => "pages", :action => "show" %> <% end %> | |
application_helper.erb: | |
def generate_menu_link(&block) | |
link = with_output_buffer(&block) | |
li = "" | |
if is_link_to_current_page?(link) |
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
show.erb: | |
<div id="slideshow"> | |
<%= | |
image_tag("GRBC_bible.gif") | |
image_tag("Hymn.jpg") | |
image_tag("world_map.jpeg") | |
%> | |
</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
Problem: trying to create a new gyro which belongs to restaurant results in | |
No route matches {:controller=>"gyros", :format=>nil} | |
Details follow. Most of the code is scaffolded, with some minor tweaks related to nesting gyros inside restaurants. | |
Restaurants_controller.rb: | |
def show | |
@restaurant = Restaurant.find(params[:id]) | |
@gyros = @restaurant.gyros |