Displaying 20 results from an estimated 21 matches for "pertl".
Did you mean:
perl
2006 Mar 21
4
Determining Browser?
Is there a way I can read the user agent or something similar to
determine whether the person is using IE, Mozilla/Netscape, Opera,
Safari, etc? I want to dynamically output the CSS to the browser, but
I''d like to change certain things (in this case the widths of some
divs since IE adds borders and padding size to the total size of a div
unlike firefox).
Thanks,
- Brent
2006 Jun 13
7
ActiveRecord attribute= overload
I want to overload the = operator for one of the attributes in a model
to run a filter on the input. However I can''t do this:
def attribute=(data)
self.attribute = filter(data)
end
because that creates an infinite recursive loop.
How do I get around this?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 20
7
AJAX/RJS Updating of Table Rows
I''m trying to update a table row (i.e. replace a <tr></tr>) using
AJAX/RJS but of course this cannot be done in IE (works fine in
Firefox). I have googled but have not found any solutions, only a lot
of discussion. Does anyone have a solution to this problem?
Cheers,
Nicholas
2006 Mar 15
1
rake + http proxy
is there a way to use
> rake freeze_edge
over a http proxy (in windows) ?
2006 Jun 30
4
always show 2 decimal places
Hi,
I have a float that often looks like somthing like 2003.2 in my
controller (1 decimal place)
Is there a way to always show it to 2 decimal places eg 2003.20 ?
Thanks
Scott
--
Posted via http://www.ruby-forum.com/.
2006 Mar 27
1
polymorphism + inheritance
Hi,
currently I do some work with polymorphic associations in egde rails
class Order < ActiveRecord::Base
belongs_to :payment, :polymorphic => true
end
class CreditCardPayment < Payment
end
class PayPalPayment < Payment
end
class Payment < ActiveRecord::Base
has_one :order, :as => :payment
# common stuff in here
end
I want to use [Payment] for common functionality
2006 Mar 22
5
foreach item in column
Hi there,
I have a database with phonenumbers, and I want to make a function
that runs a command for each of these numbers, with the number as an
argument
Something like this in Perl:
system("/bin/command $number");
mysql> select * from numbers where list = "one"
+----+----------+----------+---------------------+-----------+
| id | number | name | email
2006 Jun 23
6
float calculation error
Hi
I have the following values
pActualCost = 33.00
pPaymentCost = 29.99
So this calculation should leave me with 0.01
pPaymentDifference = pActualCost - pPaymentCost
however when doing this in rails, it returns 0.00999999999999801
has anyone got any suggestions to whats going wrong and how I can
correct this
Thanks
Scott
--
Posted via http://www.ruby-forum.com/.
2005 Dec 15
5
Rails vs. J2EE: Sharing state in memory?
Hi,
I am from a Java background and pretty new to Ruby and Rails.
What I am wondering is how I would shared state accross requests and users
without involving IO, i.e. use memory.
My current understanding is that for each request a new process ist spawn
and therefore it gets its own memory. So no sharing can take place between
requests?
Do I understand this right? For those who know
2006 Mar 04
4
Two quick newbie questions
2 quick questions regarding authentication ...
1) the flash[:notice] on successful login looks completely wrong to me.
How should it be done?
def index
if request.post?
@user = User.new(params[:user])
authentic_user = @user.attempt_login
if authentic_user
session[:user_id] = authentic_user.id
flash[:notice] =
''Login successful! Welcome
2006 Jun 18
2
convert timespan to verbose description
Hi,
I always see RoR pages showing the elapsed time like that
''Published 3 days, 23 hour and 5 minutes ago''
''Published less than 3 minutes ago''
I guess this conversion can be done using a Rails function, however I
can''t find it.
Does somebody know its name??
Thanks a lot
Peter
2006 Jun 23
1
instantiate record in single table inheritance
Hi,
is there a way to instantiate a _concrete_ subtype from within an
ActiveRecord collection?
Example:
class Link < ActiveRecord::Base
end
class InternalLink < Link
end
class ExternalLink < Link
end
internal_link = my_navigation.links.create_[xxxxxxx]
external_link = my_navigation.links.create_[xxxxxxxx]
the [xxx] is what I am missing...
I could do this
external_link =
2006 May 13
0
rake doc:app and /lib
Hi folks,
I wonder if there is there any good reason why the rails-lib directory is
not included in the rake doc:app task?
Does somebody know how to change that?
Cheers
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060513/5a6f8cff/attachment-0001.html
2006 May 13
0
integration: assert_template() always fails...
Hi Coders :-)
Maybe somebody can help...
My integration tests always fail when using assert_template()
class ShopTest < ActionController::IntegrationTest
def test_very_simple
get("/shop/index")
assert_success
assert_template("/shop/index")
end
end
the "/shop/index" is a valid url which renders flawlessly in the browser. however, the test
2006 Apr 05
0
Howto disable Firefox Drag + Drop
Hi,
I am trying to implement some custom drag and drop using javascript.
However, in Firefox, the drag and drop extension seems to interfere with
my custom handling of onMouseDown, onMouseMove and onMouseUp.
Once I start to drag the mouse (left-mouse-down + move a few pixels)
firefox shows a drag-forbidden symbol (circle with a diagonal bar inside).
Does anybody know how to disable this firefox
2006 Apr 29
1
reloading include-modules inside controller not working
Hi guys,
I would expect an ActionController-derived class to reload _completely_ in
development mode.
class FooController < ApplicationController
include FancyStuffSupport
def index
# bla
end
# more actions here
end
However, the ''FancyStuffSupport'' is not reloaded, only the ''FooController''
itself. Can this behaviour be changed? I feel back
2005 Dec 15
0
remote forms
can somebody explain me the purpose / difference between
form_remote_tag
and
submit_to_remote
both do ajax requests, but which of these is intended for what?
thx
Peter
2005 Nov 06
1
mixins not reloaded as expected?!
Hi guys,
in development mode a module mixed into a helper class seems not to be
reloaded
inside app/helpers:
class TestHelper
include EvenMoreHelp
#foo
end
module EvenMoreHelp
# bar
end
the contents of #foo get refreshed, but not #bar...
is there a way to fix that behaviour.
I intend a full reload in development mode for obvious reasons.
Regards
Peter
2006 Jun 24
6
convert 0, "0", "true", etc. to boolean
Hi,
is there a ruby / rails builtin function that converts
- 0 / 1
- "0" / "1"
- "yes" / "no"
- "true" / "false"
to a boolean?
cheers
peter
2006 Mar 04
1
active migration gives undefined_method ''string_to_binary''
has anyone ever seen that:
c:\rails\test>rake migrate --trace
(in c:/rails/test)
** Invoke migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute migrate
rake aborted!
undefined method `string_to_binary'' for
ActiveRecord::ConnectionAdapters::ColumnDefinition:Class