Displaying 20 results from an estimated 400 matches similar to: "javascript help"
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 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
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
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 26
2
resorting a dataset
Quick question to see how I might re-sort an Activerecord data set. Let''s
say I have this table:
tablename: testscores
| id | student | score | avg_for_year
1, steve, 85, 82
2, tom, 84, 92,
3, jim, 92, 95
In my controller, I have something like:
t= Testscores.find(:all, :order => "score DESC", :limit => 2)
...where it would return the records for Jim and Steve....
My
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
2006 Apr 16
2
conditional updated_on update
Hi list,
I''ve got some counter_caches in a model. When these get incremented - say on
a page view - my updated_on column also gets updated. How can I
conditionally not update updated_on if just these counter_cache columns
change?
The problem with that is that I am using acts_as_versioned which clones the
record each time updated_on changes. I am successfully ignoring the
counter_cache
2006 Feb 10
3
robots.txt best practices
I''d been ignoring this error message in my log for a while:
ActionController::RoutingError (Recognition failed for "/robots.txt"):
I had never touched robots.txt. So I decided to make it a proper robots.txtfile
I found this great article...
http://www.ilovejackdaniels.com/seo/robots-txt-file/
...where Dave explains the ins and outs of the file.
Before I changed mine, I
2006 Feb 09
6
troubleshooting an observe_field
Hi,
I''ve got a live_search field in a partial that is on several different
pages. On all pages, except 1, it works fine. On the page it doesn''t work
on, it seems it never executes it action.
Here''s my observe_field code inside the partial:
<h1><label for="searchtext">Live Search:</label></h1>
<%= text_field_tag :searchtext
2006 May 29
4
Time-based cache fragment expiration
Hello,
I''m trying to figure out how I could implement fragment caching that
expires every x amount of time. I thought of writing a runner script
that would expire the cache and set it as a cron job, but that
doesn''t really work because runner scripts act on models and not
controllers.
Does anybody have any ideas?
Regards,
-carl
2006 Apr 02
5
adding primary_key to join table using migrations
Hi list,
My tag_question_user join table is not currently a full-blown model. It
doesn''t have a primary key - just tag_id, question_id, and user_id.
I now want to add a primary key to this model (because I want to add a
"description" column as well so users can describe the tag.
I''m not sure how to add this using migrations.
Here is what I have:
class AddNotesToTags
2006 Mar 20
3
help: acts_as_versioned setup error "undefined local variable or method ''base_class''"
Hi All,
Rails newbie here trying to set up acts_as_versioned according to Chapter 14
in the Rails Recipies book. I''ve taken the following steps (nearly
verbatim) as mentioned by the book:
- created the target model "Post"
- added the "acts_as_versioned" label to the model file
- generated a migration file
- added the table creation code and the command
2006 Jan 12
3
what about Austin railers?
If Tuscon has some rail users, I know there must be some other Austin
railers out there. Have I missed some meetings that I didn''t know about?
Steve
http://www.smarkets.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060112/c2723541/attachment.html
2008 Dec 10
3
rspecing rjs - form.reset(''form'')
Hello,
>
> I couldn''t find much info on this.
>
> How do you rspec this: page.form.reset("form")
>
> I looked in the have_rjs source code and I can''t find anything on form
> reset.
>
> Thanks,
>
> --
> Andrei
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2010 Feb 06
1
accepts_nested_attributes_for with has_many => :through
I have two models, links and tags, associated through a 3rd model,
link_tags. I added the following to my link model,
has_many :tags, :through => :link_tags
has_many :link_tags
accepts_nested_attributes_for :tags, :allow_destroy => :false,
:reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } }
and put this in a partial called by the new and edit forms for links,
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
2005 Dec 19
2
Rails + Amazon
Hi,
how to integrate Amazon product search into rails? I want to put some
books on my site wih the amazon API.
I found this:
http://journal.gleepglop.com/articles/2005/06/06/amazon-on-rails
but unfortunately the example code is 404ed and I am not quite sure if
I understood everything.
So I f there is some more rails + amazon info out there I would be
happy if someone could point me there!
2006 Jan 31
4
RoR production app does not refresh
Hi,
We have a RoR app deployed using Apache + fastcgi in production mode.
When we make a change to say a controller filie on the server and go
back to that page that executes that controller action it takes no
effect. Does Rails cache pages and if so how does one force the new page
to be used?
Thanks,
2006 Apr 02
3
updating the dom
Hi list,
Say I''ve got a page that lists the students names and grades. Grades are
clickable using a form_remote_tag that then renders a new partial on the
right hand side of the page that then lists the individual test scores for
the particularly student. So far so good.
And lets say in the newly rendered right-hand section, I have another
form_remote_tag that will allow me to input a