My Recent Pastes (64 and counting)
Recent Pasties by celeretaudax (64 and counting)
Below are summaries of the 15 most recent pasties by celeretaudax.
November 17, 2008
11:46PM EDT
by celeretaudax
View more (30 lines)
1 2 3 4 5 |
##helper_method in application_helper.rb def infowindow_for(object) p = "#{object.address}<br/>" p << "<input type='button' value='Edit' onclick='$(" |
November 16, 2008
12:09PM EDT
by celeretaudax
View more (11 lines)
1 2 3 4 5 |
##helper #I want this to return a count of how many attributes aren't blank, currently I get 1, I should be getting 5 def nil_blank_count(object, count = 0) object.attributes.each do |stuff| |
November 16, 2008
3:23AM EDT
by celeretaudax
View more (14 lines)
1 2 3 4 5 |
##helper def nil_blank_count (object) count = 0 object.attributes.each do |stuff| |
November 11, 2008
12:51AM EDT
by celeretaudax
1 2 3 4 5 |
validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :if => :email_required? def email_required? !self.email.nil? end |
November 11, 2008
12:27AM EDT
by celeretaudax
View more (32 lines)
1 2 3 4 5 |
rake RUBYARCHDIR=/usr/lib/ruby/gems/1.8/gems/nokogiri-1.0.4/lib RUBYLIBDIR=/usr/lib/ruby/gems/1.8/gems/nokogiri-1.0.4/lib (in /usr/lib/ruby/gems/1.8/gems/nokogiri-1.0.4) checking for xmlParseDoc() in -lxml2... no checking for xsltParseStylesheetDoc() in -lxslt... no checking for #include <libxml/xmlversion.h> |
November 02, 2008
9:53PM EDT
by celeretaudax
View more (14 lines)
1 2 3 4 5 |
class Personal < ActiveRecord::Base # Associations belongs_to :user |
November 02, 2008
3:51AM EDT
by celeretaudax
View more (31 lines)
1 2 3 4 5 |
<html><body><script type='text/javascript' charset='utf-8'> var loc = document.location; with(window.parent) { setTimeout(function() { window.eval('try {\n$(\"avatar_form\").toggle( |
November 02, 2008
12:58AM EDT
by celeretaudax
View more (45 lines)
1 2 3 4 5 |
<% if @user.personal.nil? %> <% remote_form_for :personal, :url => new_user_personal_path(@user), :html => { :method => :put } do |f| %> <% end %> |
November 01, 2008
9:27PM EDT
by celeretaudax
View more (31 lines)
1 2 3 4 5 |
## console lovebucket@lovebucket-laptop:~/apps/stat$ script/console Loading development environment (Rails 2.1.2) >> u = User.find(1) |
November 01, 2008
3:45PM EDT
by celeretaudax
View more (20 lines)
1 2 3 4 5 |
##user.rb #Everything works except the user's password doesn't get updated in the database, I think it might be conflicting validations or possibly that I am setting it wrong. def send_new_password |
October 28, 2008
11:38PM EDT
by celeretaudax
View more (75 lines)
1 2 3 4 5 |
<html><body><script type='text/javascript' charset='utf-8'> var loc = document.location; with(window.parent) { setTimeout(function() { window.eval('try {\n$(\"avatar_form\").toggle( |
October 28, 2008
10:16PM EDT
by celeretaudax
View more (58 lines)
1 2 3 4 5 |
## profiles_controller.rb # PUT /profiles/1 # PUT /profiles/1.xml def update |
October 28, 2008
8:57PM EDT
by celeretaudax
View more (18 lines)
1 2 3 4 5 |
## profile_controller.rb before_filter :get_user protected |
October 28, 2008
1:35PM EDT
by celeretaudax
View more (348 lines)
1 2 3 4 5 |
##show.html.erb <% if @user = current_user %> <%= render :partial => 'profiles/about_me_edit_button' %> <% end %> |
October 28, 2008
1:25PM EDT
by celeretaudax
1 2 3 |
@tags.each do |element| element.sub! "#{element}", "<%= link_to('#{element}', :url => { :controller => 'tags', :action => '#{element}' }) %>" end |
Pastie