Displaying 20 results from an estimated 6000 matches similar to: "resorting a dataset"
2005 Dec 21
7
use of SET command in find_by_sql
Hi,
I''m trying to execute something like this method in a model:
def self.sql_for_rankings()
sql = "SET @counter:=0;"
sql << " SET @counter:=0;
SELECT *, @counter:=@counter+1 AS rank
FROM testscores. "
find_by_sql(sql)
end
Where the new rank column is a kind of autoincrementer inside of
2005 Dec 29
5
help with installing login_engine
Hello,
I did a script/plugin discover
then script/plugin engine
then script/plugin login_engine
The discover worked, but I get engine and login_engine not found.
I am using a Mac
Thanks
Frank
2006 Jan 09
9
Noob, installing rails on a goDaddy virtual server?
Hi,
I''m completely new to all of this. Not even certain this is an
appropriate forum for an installation question.
I''m just about to plunk down some money to get a virtual server. In
looking over the list of isp''s elsewhere on this site, goDaddy isn''t
mentioned - probably because they don''t offer rails as a standard
distribution. There are some
2006 Mar 24
4
validate if different?
Hi, I seem to remember seeing the equivalent of saving only if all
attributes are different. I can''t seem to find that now in the API or the
agile book.
I''m using the acts_as_versioned and only want to save if the input is
different.
Thanks,
Steve
http://www.smarkets.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2005 Dec 18
3
could you give me a hand?
hi.
i try to record a global array to save on-line member.
it''s put this array in controllers/application.rb or not?
my code like this:
$online_users = Array.new
and each member sign in will add himself to $online_users.
miss something?
all regards
--
Posted via http://www.ruby-forum.com/.
2006 Mar 31
4
javascript help
Hi list,
I have a list of tags. I want to be able to click on a tag and have that tag
name populate an input field. I think delicious used to allow you to click
on existing links to tag your bookmark similar to this (moving instead to
auto_complete).
My guess is the code looks something like this....
<form>
<input type="text" name="all" id="discover"
2005 Dec 19
1
New rails site. Beta testers need.
Hi Rails List,
I need some beta testers for my new site: http://www.smarkets.net. This list
is literally the first group to see it, so be gentle.
Smarkets is a prediction market for Amazon products. It takes Amazon
products and turns them into a stock. The price of these "stocks" move based
on the movement of its Amazon sales rank. If the sales rank goes up 10%, the
price of the stock
2005 Dec 21
8
textilize - redcloth
Hi,
I''m using textilize with redcloth 3.0.4. Everything works best except
that paragraphs are not translated as an HTML paragraph
When I write something like:
*first paragraph*
second paragraph
the output is without paragraph:
*first paragraph*
second paragraph
Any help??? Thanks
Jörg
2005 Dec 29
5
Subversion graphical client?
Hi All -
I notice that most of the Rails team are using Mac OS X and TextMate for
Ruby development. I too am working on Mac OS X and trying TextMate and
(shudder?) EMacs.
I was wondering about version control. Are folks using Subversion? If
so, are they using a graphical client? Which one do they recommend?
Yours,
Jordan
--
Posted via http://www.ruby-forum.com/.
2006 Mar 08
2
RailsConf speakers
Does anyone have a clue as to when the railsconf speakers will be
announced?
Thanks-
-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
ezra@yakima-herald.com
2005 Dec 17
2
Encrypting files
Anyone know of a good (fast) way to encrypt/decrypt uploaded files in
RoR? I''ve seen this project: http://ezcrypto.rubyforge.org/ but it
only seems to encrypt strings and such. I need to encrypt files once
they are uploaded, then decrypt them when they request the file back.
Any ideas?
Thanks,
Mark
--
Posted via http://www.ruby-forum.com/.
2006 Apr 17
3
help debugging an error
Hi, I''ve started getting an error I can''t debug. The error doesn''t generate
anything in my development log. A breakpoint set right at the beggining of
the controller method does not get triggered. It happens on a form
submission. I can make changes to the object model from with the console,
but not on this form submission. I thought maybe it was routing, because I
have
2005 Dec 15
3
session scope?
Hi all,
I''m working on a Rails application. In this application I retrieve a list of
''brands'' using a method somewhere defined in my controller:
private
def get_brands
@brands = Product.find_by_sql("select distinct brand from products");
end
However, I display this information in a listbox in the template for my
controller.
This means @brands
2006 Mar 15
7
Populating text_tag with serialized data
I am using a serialized attribute in one of my models The serialized data is
in the form of an array. I want to have a text_tag for each element
contained in my serialized attribute. How would I construct the text_tag?
My model name is ''questions''. The serialized attribute is "answers"
So I might have:
<% form tag %>
<% text_tag ''question'',
2005 Dec 15
5
site takes a while to load after first visit in a while
Using lighttpd + fcgi to power a site. When no one has accessed it in
a while, the first visit to the page takes a while to load up. Then
subsequent visits are fairly fast.
Any ideas on how to fix it?
2005 Dec 08
3
lighttpd proxy w/ apache2
I''ve tried a bunch of things trying to get ruby/apache2 and php working
together. I looked over my earlier post and followed the instructions
on ezra''s website to install lighttpd on debian. I''ve gotten really far
but I think there is one bit missing:
1. I got apache2 and php working together
2. I got lighttpd working on port 3000 and my rails app launches ok
2005 Jun 07
13
My Rails Day entry: internet command line
Well, my entry for the 24-hour Rails Day competition is here: http://yubnub.org
. It''s a web app called YubNub that implements the grandiose idea of a "command
line for the Web OS". Type "gim porsche
911" to do a Google Image search
for Porsche 911 cars. Type "random 1000" for a random number between 1 and
1000. Type "tts David Heinemeier Hansson is
2005 Oct 11
4
Searching an attribute in a hmabtm relationship
(Nuby to Ruby and Rails...)
I''ve implemented security using the login generator in a simple app so
that I have a user table, a roles table, and a join between them
(roles_users). All works as expected. I now need to check if a user
has a specific role, but my approach is off somehow.
Here''s what I''ve tried thusfar:
user_roles = @session[:user].roles
2006 May 11
9
acts_as_commentable plugin
I''ve just about finished up work on a plugin similar to
acts_as_taggable, but for comments instead which would allow you to
attach comments (possibly even a threaded discussion if conbined with
acts_as_tree) to any object. Is there anyone that would be interested
in it? I don''t want to go throug the trouble of finding some way to
distribute it unless I know that there is a
2005 Dec 22
3
help with unless
Hi,
I need a fresh set of eyes to look at this bit of controller code and tell
me why I might be getting an error message:
lookup = Profit.find(:all, :conditions => [ "user_id = ? AND
product_id = ?", uid, pid])
unless lookup.empty?
if (lookup.updated_on > 360.minutes.ago)
return
end
end
If lookup is empty, then I