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
// ***** Roast Theme | |
!base_color_1 = #2D1E1E | |
!base_color_2 = #4B3C37 | |
!base_color_1_light = !base_color_1 + #212121 | |
!base_color_1_lighter = !base_color_1 + #444444 | |
!base_color_1_dark = !base_color_1 - #111111 | |
!base_color_2_light = !base_color_2 + #212121 | |
!base_color_2_lighter = !base_color_2 + #444444 |
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 Theme | |
!base_color_1 = #212121 | |
!base_color_2 = #660000 | |
!base_color_1_light = !base_color_1 + #212121 | |
!base_color_1_lighter = !base_color_1 + #444444 | |
!base_color_1_dark = !base_color_1 - #111111 | |
!base_color_2_light = !base_color_2 + #212121 | |
!base_color_2_lighter = !base_color_2 + #444444 |
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
post.comments.sort_by(&:created_at) |
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
post.comments.sort_by(&:created_at).reverse |
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 id="comments"> | |
<%= render @post.comments %> | |
</div> | |
<% form_for [@post, Comment.new], :remote => true do |f| %> | |
<%= f.label :body %><br /> | |
<%= f.text_area :body, :rows => 5 %><br /> | |
<%= f.submit %> | |
<% 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
$('comments').insert( { bottom: "<%= escape_javascript(render @comment) %>" } ); // Insert the _comment partial at the bottom of the comments list | |
$$('.comment').last().highlight(); // Highlight the last comment (the one you just inserted!) | |
$('comment_body').clear(); // Clear the form text area |
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 CommentsController < ApplicationController | |
respond_to :html, :xml, :js | |
def create | |
post = Post.find(params[:post_id]) | |
@comment = post.comments.build(params[:comment]) | |
if @comment.save | |
respond_with(@comment) | |
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
# Middleware | |
use Rack::Codehighlighter, :coderay, :element => "pre", :pattern => /\A:::(\w+)\s*\n/ | |
require ::File.expand_path('../config/environment', __FILE__) | |
run Test3app::Application |
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 Application < Rails::Application | |
config.middleware.use Rack::Codehighlighter, :coderay, :element => "pre", :pattern => /\A:::(\w+)\s*\n/ | |
. | |
. | |
. | |
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
:! irb -r % |