Displaying 20 results from an estimated 6000 matches similar to: "Determining Browser?"
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 22
5
Class Caching Problem [was Newbie Question about Custom Classes]
So any other ideas as to why my custom class under app/models is being
cached even though all the caching is set to false in the
config/environments/* files? Currently I''m having to restart WEBrick
after EVERY change to the file. The controllers and views are
reloading just fine and not being cached. It''s just the custom class
I created that''s being cached.
Any ideas
2006 Mar 02
3
How to identify the browser?
I need to generate some browser-specific code; can I identify which
browser is being used from within my RoR code?
--
Posted via http://www.ruby-forum.com/.
2006 Mar 30
6
Global Method Declaration?
Is there a place where I can put a method that can be accessed in both
views and controllers?
Here''s the situation, maybe someone can suggest a better way to go about this:
I created my own custom login system with email verification and user
roles (basically, I tinkered around with SaltedHashLoginGenerator
until I finally gave up and wrote my own). One role, of course, is an
admin
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 Mar 20
24
Newbie Question about Custom Classes
Sorry if this is a complete newbish question, but I''m trying to wrap
my head around creating custom classes in my rails webapp. I''m
normally a Java developer, but I figured I''d give RoR a try and see
how I like it, and whether it would be useful for production use with
a new client.
Anyways, what are the best practices for custom classes? Where and/or
how do I create
2006 Apr 04
2
Pagination and Parent Conditions
Can I do any "fancy" conditionals when using the Pagination helper?
The problem is that I want to be able to specify a conditional based
on the criteria of a parent object. Here''s an example:
Object A has_many Object B''s
I want to paginate through 100 B''s but I *only* want it to return the
ones who''s A.flag = true
I poked around through the Wiki
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 Apr 05
7
select_tag - populating options
Hello,
I want to a select tag, where you can choose a number between 1 and 100.
My inital code is based on the examples from Agile Web Development with
Rails, and looks like this:
view:
<%= options = [["Select number of lines", ""]] + RfqLines::LINE_QTY
select("rfq_line", "line_qty", options) %>
model:
LINE_QTY = select_fill
def
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
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 Apr 10
6
detecting browser type?
I''m wondering how i can detect the browser type for the client. I know this
is possible, but i cant seem to find how to do this, nor any example code
for this.
I would appreciate if someone could point me to some info or just give me an
explanation.
thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2019 Jan 22
3
samba_dns_question
Hai Rowland,
I think you are mixing a few settings.
http://www.zytrax.com/books/dns/ch7/queries.html#additional-from-auth
additional-from-auth yes | no ;
additional-from-cache yes | no ;
And
www.zytrax.com/books/dns/ch7/queries.html#auth-nxdomain
auth-nxdomain yes | no;
If auth-nxdomain is 'yes' allows the server to answer authoritatively (the
AA bit is set)
when returning
2006 Mar 02
4
Instance variables in Javascript param
How can I make this work ?
<a href="#" onclick="new Effect.Fade(@div_id)"></a>
@div_id is an instance variable ?
TIA
--
Posted via http://www.ruby-forum.com/.
2006 Apr 07
1
[FYI] issues with integration testing
I was working on an integration test to test login/logout functionality and
came across an issue that took me a bit to figure out.
In one of my controllers, I have to test the request.env["HTTP_USER_AGENT"]
value as a portion of the app will be access by Windows CE hand-helds. in
the controllers index action i had the lines
logger.info "user agent: " +
2004 Aug 06
3
icecast2 ogg vorbis client request headers
Can anyone shed some light as to what icecast2 accepts as a client request methods for ogg vorbis,
apparently there is a difference bettween the way icecast2 handles mp3 and ogg vorbis.
php example for mp3 that works
fwrite($fp,"GET /mymp3 HTTP/1.1\nUser-Agent:$HTTP_USER_AGENT\n\n");
php example for ogg that doesnt work
fwrite($fp,"GET /mymnt.ogg
2008 Sep 30
4
Using the response object in stories
I have this statement in the layout of my application (using haml)
- if request.env["HTTP_USER_AGENT"].include?("MSIE")
= stylesheet_link_tag ''blueprint/ie.css''
= stylesheet_link_tag ''confirm_ie.css''
The problem is that request.env["HTTP_USER_AGENT"] is nil when I go to
some page in the features I write with cucumber and webrat
2006 Mar 04
13
Using helpers from controllers ?
There is a solution to use helpers from controllers ?
I have an error :
|undefined method `content_tag''|
class ApplicationController < ActionController::Base
def test
return content_tag("a","test")
end
end
2006 Jun 22
12
invalidating a session on multiple login
How do I do the following: if a user is logged in, then opens another
browser tab and logs in again (either as himself or as someone else),
I want to invalidate the session in the first tab and throw up a
"logged in from another browser window" screen. RIght now, user1''s
session silently becomes a duplicate user2 session instead (from what
I understand, sessions are bound to