My Recent Pastes (97 and counting)

Pastes by celeretaudax (97 and counting)

Pages: 1 2 3 4 6

Below are the 15 most recent pasties by celeretaudax.

May 08, 2008
10:27PM EDT
by celeretaudax

class PagesController < ApplicationController
  
  verify :params => :name, :only => :show, :redirect_to => :root_url
  before_filter :ensure_valid, :only => :show

May 07, 2008
6:08PM EDT
by celeretaudax

  def time_ago(time)
    time = Time.now.to_i - time.to_i
            if time < 1
              "#{time} milliseconds ago"
            elsif time < 60

May 06, 2008
2:44PM EDT
by celeretaudax

##why won't this damned thing updated my user's replied attribute to 1?

 def create
   @post = Post.find(params[:post_id])
   @comment = @post.comments.build(params[:comment])

May 05, 2008
11:41PM EDT
by celeretaudax

class ContactsController < ApplicationController
    def new
        @page_title = "New Contact"
    end
    

May 01, 2008
4:59PM EDT
by celeretaudax

Processing PostsController#show (for 127.0.0.1 at 2008-05-01 15:58:52) [GET]
  Session ID: BAh7CToMY3NyZl9pZCIlNDZkYTI4ZWY5MTgwOGM0YWM4MTA0ZTU5OGY4ZmE1%0AZGQ6CXVzZXJpBjoTc2ltcGxlX2NhcHRjaGEiLTQ5ZmEyMjA4MmUwYjI2MzY4%0AMWM4Mjg4NmZmZGI3OTk4YTk0Y2FhYTkiCmZsYXNoSUM6J0FjdGlvbkNvbnRy%0Ab2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA%3D--945a8769280097383019732e79112fbcac049e62
  Parameters: {"action"=>"show", "id"=>"1_jtlkjalkjdfljlkadsjflknnannsdakfjlkksadjlfkjjsalj", "controller"=>"posts"}
  Post Columns (0.001423)   SHOW FIELDS FROM `posts`
  User Columns (0.022780)   SHOW FIELDS FROM `users`

May 01, 2008
4:11PM EDT
by celeretaudax

page.visual_effect :fade, "comment_rate_#{rateable.id}"
         page.replace_html "comment_rate_#{rateable.id}", :partial => "downvoted", 
                                                        :locals => { :asset => rateable}
         page.visual_effect :toggle_appear, "comment_rate_#{rateable.id}"

April 29, 2008
6:41PM EDT
by celeretaudax

class Comment < ActiveRecord::Base
  belongs_to :commentable, :polymorphic => true, :counter_cache => true
  belongs_to :user
  has_and_belongs_to_many :related, :join_table => 'related_comments',
                        :foreign_key => 'first_comment_id',

April 29, 2008
1:13PM EDT
by celeretaudax

##show.html.erb
<h2>Comments</h2>
     <% unless @post.comments.blank? %>
        <div id="comments">
                <%= render :partial => 'comments/comment', :collection => @post.comments %>

April 28, 2008
4:32PM EDT
by celeretaudax

##create.rjs
page.insert_html :bottom, 'tasks', :partial => 'task', :locals => {:task => @task}
page.['task_form'].reset

##_form.html.erb

April 28, 2008
2:24PM EDT
by celeretaudax

##tasks/hello.js.erb
page.alert "hello world"

##routes.rb
ActionController::Routing::Routes.draw do |map|

April 23, 2008
11:53PM EDT
by celeretaudax

##view
<h2>Comments</h2>
        <% for comment in @post.comments %>
                <div id="comment">
                        <div id="comment_username">

April 23, 2008
5:04PM EDT
by celeretaudax

  def create
   @post = Post.find(params[:post_id])
   @comment = @post.comments.create(params[:comment])
   @comment.user_id << logged_in_user.id

April 20, 2008
11:35PM EDT
by celeretaudax

##in your controller

  def districts

    responds_to |format| do

April 17, 2008
12:38AM EDT
by celeretaudax

# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
        
        def super_title
                content_for(:super_title) [:title, :subtitle].join(" + ")

April 16, 2008
2:09PM EDT
by celeretaudax

# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
        def super_title
                [title, sub_title].join "+"
        end

Next page

Previous page