Displaying 15 results from an estimated 15 matches for "tkxtfpmj4ozk1umjsbkqmq".
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 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 Sep 04
2
"include" versus "extend" - what's the difference
Hi,
Just wondering when one would use "include" over "extend"? Both seem to
bring in methods to the class no?
The context is I''m just trying to understand why both are used with the
acts_as_audited plugin:
Full extract from plugin (used within here):
==================================================
# Copyright (c) 2006 Brandon Keepers
#
# Permission is hereby
2007 Aug 09
7
Integrating polymorphic models into controllers views? how?
I''m having trouble trying to get this to work.
How the heck do you get a polymorphic controller to work? Especially
integrating it with a view?
Let''s say that we have shows, and episodes, then comments.
A show has many episodes, an episode has many comments.
the route is /shows/1/episodes/1/
Now to add a comment to that episode, how would I do it? Let''s say
that the
2007 Aug 10
2
uninitialized constant MiniMagic (NameError)
Hi,
Mini-Magick breaking. I have installed mini-magick gem.
Here is my sample program
require ''rubygems''
gem ''mini_magick''
include minimagick
image = MiniMagick::Image.from_file(''./fun.jpg'')
image.resize "100x100"
image.write(''./funthumb.jpg'')
Output:
test.rb:3: undefined local variable or method
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
2007 Aug 15
2
has_many :through ... What am I missing?
class Ladder < ActiveRecord::Base
has_many :players
has_many :users, :through => :players
end
class Player < ActiveRecord::Base
belongs_to :users
belongs_to :ladders
end
class User < ActiveRecord::Base
has_many :players
has_many :ladders, :through => :players
end
When I try the following code (on the console) I get an error:
@ladder = Ladder.find(1)
@ladder.users
I
2006 Aug 30
10
respond_to not detecting JS turned on. form_to_remote problem?
I''m trying to use respond_to to redirect visitors who have JS turned off to a different page. The problem I''m having is that respond_to is sending *everybody* there. It''s not recognizing that JS is turned on in the browser. The wanted_html.rhtml file below is rendered whether I''ve got JS turned on or off. I''ve looked at the Accept headers being sent
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 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 Dec 27
10
Mixing html tags and Ruby blocks
I''m trying to get the following idea to work:
<%= @column_names.each { |t| <td> t.downcase </td> <td>
@listing.send(t.downcase)</td> } %>
Essentially I want to display a form that has a left and right TD, with
the left TD being a column name and the right TD being the column data.
If there''s a better way (the Rails way ?), I''m all ears
2007 Jan 04
0
[ADV] Ruby/Rails training in Alexandria, VA, by Accelebrate
Hi --
Accelebrate[1] is presenting a four-day Ruby for Rails training
course, February 6-9, 2007, in Alexandria, Virginia. I will be the
instructor.
The course covers beginning through intermediate Ruby and Rails, and
is a good fit for anyone who''s starting out on their own and wants to
get the fundamentals down solid.
You can get more information, and registration details, at