Displaying 20 results from an estimated 51 matches for "dablog".
Did you mean:
yablog
2006 Jun 21
0
[MINI-ANN] DABlog
Hi --
Just a quick note to announce the creation of DABlog, David A. Black''s
Log, at http://dablog.rubypowerandlight.com. You can also reach it at
http://dablog.rubypal.com, if you want to type less :-) DABlog runs
on Typo.
Meanwhile, greetings from Chicago -- I hope I''ll see lots of you here.
David
--
David A. Black (dblack@wobbli...
2006 Jul 31
2
[UPDATE] More info on RubyConf 2006 registration
...39;'re only taking credit cards, etc.).
David
P.S. Any LA area Rubyists around? I''ll be there this week doing Rails
training.
--
http://www.rubypowerandlight.com => Ruby/Rails training & consultancy
----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <-----
http://dablog.rubypal.com => D[avid ]A[. ]B[lack''s][ Web]log
http://www.manning.com/black => book, Ruby for Rails
http://www.rubycentral.org => Ruby Central, Inc.
2006 Jul 30
8
Method_missing from Ruby for Rails book
I''m having a problem getting this example from the book to work:
class Cookbook
attr_accessor :title, :author
def initialize
@recipes = []
end
def method_missing(m, *args, &block)
@recipes.send(m, *args, &block)
end
end
cb = Cookbook.new
cb << recipe_for_cake
cb << recipe_for_chicken
beef_dishes = cb.find_all {|recipes| recipe.main_ingredient ==
2006 Jul 17
14
REST Relationship Models
I''m trying to figure out an elegant way to do this:
I have the following three tables:
people, employer, employees
And consequently the following three models:
class Person < ActiveRecord::Base
end
class Employer < ActiveRecord::Base
has_many :employees
end
class Employee < ActiveRecord::Base
belongs_to :person
belongs_to :employer
end
I want to be able to say:
2006 Oct 30
7
belongs_to nonintuitive results with assignment?
class Page < ActiveRecord::Base
has_many :lists
end
class List < ActiveRecord::Base
belongs_to :page
end
######### controller code, inside action:
list = List.find(params[:id])
old_page = list.page
list.page = new_page
# what is the value of old_page now?
old_page now is the same as new_page! what the heck?!?
The only thing i can think of is that old_page is
2006 Nov 04
0
Free Rails workshop in Malmo, Sweden, Sept. 17
...out/ruby-on-rails-workshop-by-david-black
Hop on over from London if you''re at RailsConf Europe! (Which
[London] is where I am now.)
David
--
David A. Black | dblack@wobblini.net
Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB''s Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com
[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org
2006 Sep 28
2
RHTML page not rendering properly
I''ve got a weired problem. I got a RHTML page which is not rendered
properly in the browser all other pages in my app do renders correctly.
Only this one page returns the page''s HTML with the following header
Content-Type: text/html
Set-Cookie: _session_id=cb3c140fd4ef907c99ef203a053fba1a; path=/
Status: 200 OK
Cache-Control: no-cache
<html>
.....................
2006 Sep 29
2
ApplicationHelper is not a parent of SomeHelper?
i have:
# file application_helper.rb
module ApplicationHelper
def load_components
@right_sidebar = ''some stuffs''
end
end
# file user_public/blog_helper.rb
module UserPublic::BlogHelper
def load_components
ApplicationHelper.load_components
@right_sidebar += ''{blog archive}''
end
end
the problem is, i want to load the
2006 Oct 05
2
update_attributes
I''m working on a form that updates a product record and several
associated detail records.
The detail records are showing and populating okay in the form. But
when it hits the controller, I get Couldn''t find Detail with ID=detail
AND (details.product_id = 38). The :detail params seem to refer to the
correct record id. Anyone have an idea how to fix this?
Here''s the
2006 Nov 04
2
Possible to use attr_reader/writer in model?
I have some properties that I want setable externally, but readable only
internally. I''ve played around with attr_writer (and attr_reader
separately) but can''t figure out how to get either to work. I can do
what I want using attr_accessor, or just straight out defining the prop
setter method. Anybody know how to use attr_writer or attr_reader with a
model?
You da man,
Joe
2006 Aug 08
12
delete_if doesn''t work for has_and_belongs_to_many
I''m using Rails-1.1.4 with Ruby-1.8.4
So let''s say I have 2 model classes:
class Item
has_and_belongs_to_many :things
end
class Thing
has_and_belongs_to_many :items
end
i = Item.new
i.things << Thing.new( :value => "Something").save
i.things << Thing.new( :value => "Something Else" ).save
i.save
Fine, now I have two records in the
2006 Nov 09
2
redefining the method belongs_to in ActiveRecord::Base
Hi. I''ve tried to redefine the method belongs_to in ActiveRecord::Base,
so every time a model is defined as belonging to :attachment, it should
have some additional methods. I tried to do an alias of belongs_to, but
this was not successful. The error message in Webrick was
> Booting WEBrick...
./script/../config/../lib/ActiveRecordExtensions.rb:67: undefined
method
2006 Jul 26
2
newbie - HABTM confused...
I have a users table. I have a assignment table. and I have to log in
to see my assignments. i can and I hasve a session id.
I can make a new assignment and save my id in the user_id field of the
assigment table.
I want to share my assignments. so I can create a assignments_users
table. this way I can have assignment 1 shared with user 1 and 2. and
If I log in as user 1 or 2 I see the assignment.
2006 Sep 03
2
Undefined method "xxx" of a model when calling a helper
Hi all
I''m creating a shop page. I have a cart model that looks like the
following:
class Cart
attr_reader :line_items
def get_line_item id
@line_items.each do |l|
return l if l.id == id
end
end
def initialize
@line_items = []
end
def empty!
initialize
end
def empty?
return true if @line_items.empty?
false
end
end
And I have some
2006 Nov 04
2
Instant Rails 1.4 final released (with RadRails support!)
This is the final release for Instant Rails 1.4. It corrects the two
known problems with the preview1 release (two help menu items
caused Instant Rails to crash). Instant Rails 1.4 contains the following
major changes:
* Upgrades Rails to version 1.1.6
(other components upgraded to current release, also)
* SCGI has been replaced by Mongrel (using Apache''s
mod_proxy for
2006 Aug 01
4
class def error when serving "stand-alone" rhtml files
I''m attempting to set up a rails app so that I can add rhtml files
without having to create controllers for each one. I want a simple
solution to serving static-like rhtml files as well as those with a
little logic. The solution I found is this one:
I added the following controller
static_controller.rb
#####################
class StaticController < ApplicationController
end
I
2006 Aug 10
6
Partials - asked before never got reply
I''m trying to figure out how multiple partials in one page would be
configured when they are based on some action in the controller.
As an example -
I have a main/welcome page. If someone new or a user not logged in
arrives at this page I display both a registration form and a login
form. However, if they are logged in then those forms should not show
up on that page. Also should
2006 Jul 12
12
pass hash as parameter
Hello,
How can I pass a hash as parameter from a template with url_for?
e.g. : if I have
test = { :a => "a", :b => "b" }
How can I pass that with my request? Is it possible to pass nested
hash''es to?
Right now,
url_for :action => :test, test
doesn''t seem to work.
Thank you,
--
2006 Aug 08
1
form parameter
How can I change some parameters in a function of the controller. I have
a User_Controller, who''s responsible for update the information fields
in the database.
The parameters are "id", "firstname" and "lastname". Now, I want to
manipulate parameter "lastname", because I would like to add at the end
a point.
>> Thomas Miller
2006 Aug 13
2
Writing a Helper function
I''ve finally gotten to the point where I want to write my own helper
function to call from my views. I used the script/generate to create my
Controller so I also got the helper file.
I defined the method I wanted to use in the helper rb file, but when I
try to call them from the view I get a NoMethodError raised.
Is there anything else I have to do besides creating the method in the