My Recent Pastes (264532 and counting)
All Pasties (over 264,532 and counting)
Pages: 1 … 11831 11832 11833 11834 11835 … 13227
Below are summaries of the most recent pasties.
January 07, 2007
10:02PM EDT
View more (41 lines)
1 2 3 4 5 |
in a view i have a link that sends this to the new_photo action: http://localhost:3000/adminorden/new_photo/1 I have this actions in my adminorden controller: |
January 07, 2007
9:25PM EDT
by Skiz
View more (101 lines)
1 2 3 4 5 |
## controller code class ConsentController < ApplicationController require_gem 'captcha' |
January 07, 2007
9:22PM EDT
View more (11 lines)
1 2 3 4 5 |
def update_profile @user = User.find(self.current_user.id) @user_image = @user.user_image.build(params[:user_image]) if @user.update_attributes(params[:user]) flash[:message] = 'Profile was successfully updated' |
January 07, 2007
9:13PM EDT
View more (9 lines)
1 2 3 4 5 |
class String def rotate1(steps) size > 0 ? slice!(-steps%size..-1) + self : self end |
January 07, 2007
9:05PM EDT
1 |
<%= date_select("start", "start", :order => [:month, :day, :year])%> |
January 07, 2007
8:57PM EDT
View more (66 lines)
1 2 3 4 5 |
#!/usr/bin/env ruby require 'gtk2' window = Gtk::Window.new("Cauculadora").set_size_request(260,260) |
January 07, 2007
8:18PM EDT
View more (35 lines)
1 2 3 4 5 |
class Shape attr :x attr :y # constructor |
January 07, 2007
8:02PM EDT
by mikepence
1 |
Here is my Rails question: When you have an ar object, say @person, which contains many related objects, like @person.phone_numbers, you are now outside of the scope of having a single instance variable for the objects represented on your page. Does that mean you lose the nice form_for binding and other naming convention related conveniences? When it comes time to validate and save, whose repsonsibility is it? The controller, or the Person model? |
January 07, 2007
8:00PM EDT
by mikepence
1 |
Here is my Rails question: When you have an ar object, say @person, which contains many related objects, like @person.phone_numbers, you are now outside of the scope of having a single instance variable for the objects represented on your page. Does that mean you lose the nice form_for binding and other naming convention related conveniences? When it comes time to validate and save, whose repsonsibility is it? The controller, or the Person model? |
January 07, 2007
8:00PM EDT
by welly
1 |
Spotguide.find(:all, :limit => count, :include => :spotcomments, :joins => 'INNER JOIN contents on contents.parent_id = spotguides.id AND contents.type = "Spotcomment"', :group => 'contents.parent_id', :order => "avg(contents.rating)") |
January 07, 2007
7:54PM EDT
by Jerdent
View more (10 lines)
1 2 3 4 5 |
$ svn propdel svn:externals trunk/vendor/plugins/haml property 'svn:externals' deleted from 'trunk/vendor/plugins/haml'. svn remove trunk/vendor/plugins/haml D trunk/vendor/plugins/haml/test/haml/helper_test.rb |
January 07, 2007
7:54PM EDT
by Jerdent
View more (10 lines)
1 2 3 4 5 |
$ svn propdel svn:externals trunk/vendor/plugins/haml property 'svn:externals' deleted from 'trunk/vendor/plugins/haml'. svn remove trunk/vendor/plugins/haml D trunk/vendor/plugins/haml/test/haml/helper_test.rb |
January 07, 2007
7:53PM EDT
View more (11 lines)
1 2 3 4 5 |
#html <form action="/equipment/14/antenna_types/attach" id="antenna-form" method="post" onsubmit="new Ajax.Request('/equipment/14/antenna_types/attach', {asynchronous:true, evalScripts:true, method:'post', parameters:Form.serialize(this)}); return false;"> Antenna: <select id="antenna_type_name" name="antenna_type[name]"><option value="">Select an Antenna to Add</option> <option value="Yaggi">Yaggi</option> <option value="Panel">Panel</option> |
January 07, 2007
7:52PM EDT
View more (22 lines)
1 2 3 4 5 |
def relative_creation(time) date = Date.civil(time.year, time.month, time.day) days = (date - Date.today).to_i.abs hours = (time.hour - Time.now.hour).abs minutes = (time.min - Time.now.min).abs |
January 07, 2007
7:52PM EDT
View more (11 lines)
1 2 3 4 5 |
require 'rake' require 'rake/testtask' require 'rake/rdoctask' require 'breakpoint' |
January 07, 2007
7:48PM EDT
View more (12 lines)
1 2 3 4 5 |
# not working: <% form_remote_for :antenna_type, :url => {:action => 'attach', :controller => 'antenna_types', :id => @equipment}, :method => 'post', :update => 'antenna-form', :html => { :id => 'antenna-form' } do |f| %> Antenna: <%= f.select 'name', AntennaType.valid_names, :prompt => "Select an Antenna to Add" %> <%= submit_tag 'Attach' %> <% end %> |
January 07, 2007
7:38PM EDT
View more (15 lines)
1 2 3 4 5 |
-(/etc/logrotate.d:$)-> cat lighttpd
/var/log/lighttpd/*.log {
daily
missingok
copytruncate
|
January 07, 2007
7:36PM EDT
View more (19 lines)
1 2 3 4 5 |
-(/etc/logrotate.d:$)-> cat lighttpd
/var/log/lighttpd/*.log {
daily
missingok
copytruncate
|
January 07, 2007
7:26PM EDT
View more (162 lines)
1 2 3 4 5 |
## Windows first. #include <windows.h> #include <gil/core/gil_all.hpp> #include <gil/extension/io/jpeg_dynamic_io.hpp> |
Pastie