similar to: Sort table by child row property?

Displaying 20 results from an estimated 200 matches similar to: "Sort table by child row property?"

2007 May 14
3
Counter Problem
Hi. I have a problem with counters in Rails. The situation looks like this: -3 simple models class Forum < ActiveRecord::Base has_many :posts end class Topic < ActiveRecord::Base has_many :posts end class Post < ActiveRecord::Base belongs_to :topic, :counter_cache => true belongs_to :forum, :counter_cache => true end - In migrations i have declared t.column :posts_count,
2009 Oct 13
2
multichannel?
Hi, I was wondering if it would be possible to do multichannel encoding with CELT. From the documentation & the code I understand that CELT currently encodes mono (1 channel) or stereo (2 channels). I would like to use CELT in a multichannel setup, to encode (and stream) n mono channels. Just n mono channels, not a layout like 5.1 With vorbis I can do this, but vorbis adds a lot of
2006 Apr 10
6
image_tag adding request parameter
I have noticed that the image_tag helper method now appends a request parameter to the generated src attribute. With Rails 1.0/actionpack-1.11.2 I had <img src="/images/rss.gif" /> Now (1.1/1.12.1) I get <img alt="Rss" border="0" src="/images/rss.gif?1142366545" /> Is there any use for that number? Where does it come from? This is very far
2006 Mar 21
5
Object#id being deprecated - Rails 1.1
Hi Think this is probably straightforward, but I don''t know enough about rails to work it out, so was wondering if anyone can help I keep on running into this error when I''m deploying my app: "FastCGI: server ".../public_html/public/dispatch.fcgi" stderr: ../config/../app/views/items/_side_share.rhtml:8: warning: Object#id will be deprecated; use
2006 May 19
7
AR transactions and isolation levels
I''m trying to create a sequence with no gaps in my db (contrived example, but should work out the same as my real one), and believe db-managed transactions are the way to go about this. It''s my first real ''go'' at transactions, so I may be mistaken about how things really work. Anyway.. Consider this example code: Class Invoice < ActiveRecord::Base def
2006 Mar 09
11
syncPEOPLE on Rails TextMate Bundle 1.0 & Screencast
The 1.0 version of our bundle is now available for download, along with a 10 minute demonstration of it in use. See http:// syncpeople.com/downloads. == What is syncPEOPLE on Rails? == syncPEOPLE on Rails is a bundle of snippets, macros and commands for TextMate that make Rails development on the Mac even easier. Generate scaffolds, migrations, models and controllers from inside the
2006 Jun 19
0
has_one frustrations, please help!
Hi everyone. I''ve been bending my head around a has_one association for about 3 hours now and I can''t get it to work. I''m pretty sure it''s not something I''m overlooking anymore. Here''s the essential part of the schema I''m working with: ----- t :topics c :id c :last_post_id t :posts c :id c :topic_id ----- Topics are simply named
2006 Mar 27
2
svg image link
the link_to command is really nice, especially with confirm built in - wondering if there is a way to use it with SVG images since SVG doesn''t seem to work with image_tag I can display svg images (in Firefox) with the following code: <embed width=32 height=32 src="/images/quit.svg" type="image/svg+xml"></embed> "normal" link_to code:
2009 Oct 15
1
multichannel
Hi All, Would it be possible to encode n channels with the CELT api? I can't find a negative or positive in the CELT docs; all I could find is c a check on the nr of channels in wav_io.c in the CELT tools. No clear insight on wheter or not the channels parameter in celt_mode_create can be > 2. Answers on the list were (thanks!): - Sure, You just encode each channel and then store the
2006 Mar 09
4
cross domain cookies
Does anybody know how to access the domain of a cookie from inside rails? I am try to integrate phpbb forums into my site and one of the things phpbb does is store a cookie. The forums are at forums.domain.com and the site is www.domain.com so i needed to set the cookie domain in phpbb to just be ".domain.com" so both sites can access it. The trouble is when using cookies[] in rails,
2003 Mar 17
3
Incorrect source address in ARP request. Anyone seen this?
I''m using iproute2-ss010824 and a 2.4.20 kernel. Quite a subtle issue here, so I can imagine it has not been spotted before. The setup: I have set up a machine as a gateway. The ''external'' interface uses a dummy IP address (eg. 10.0.0.2) and the internal side is a normal address. (it''s more complex in real life using Zebra and such, but this is the basic
2006 Apr 12
13
rhtml produces so many white places?????
Hi, I have a rhtml file that uses some ruby code inside, there are not too ruby codes, but it repeats itself thousands of time. I find out each time when the ruby code execute, it will produce the html code correctly. But the produced html will conseved the "format" of the rhtml, and it adds a lot no used white space!!!! example : toto.rhtml <body> <table> <% data.each{
2006 Jul 14
5
Ideas for AJAX pagination
Hi, I am looking for ideas on how to remove the last item from a paginated page when a new item is inserted, thus leaving only 10 elements on the page. Currently I have a form that inserts with AJAX, but as expected, each post added to the page just increases the number of posts leaving 11 on a page that should only be displaying 10. I have unique ID''s for each post (e.g.
2006 Apr 10
1
Tracking 1.1.x release using svn:externals?
Now that Rails is doing regular updates to 1.1.x branch, is it possible to track the this release using svn:externals inside my app? Currently I have: rails http://dev.rubyonrails.org/svn/rails/tags/rel_1-1-1/ in my vendor directory. Can I change this to something like a wildcard ''rel_1-1-x'', ensuring that I always have the latest of the stable 1.1 branch? Cheers! Tom
2006 Jun 08
2
Activerecord Update syntax.
This what I have - sadly, it does not work :( . posts = {params[:topic][:forum_id] => { "posts_count" => "posts_count + @topic.posts_count"}, @topic.forum_id => { "posts_count" => "posts_count - @topic.posts_count" } } Forum.update(posts.keys, posts.values) It''s suppose to subtract the posts_count from topic, and add it and subtract
2006 Mar 30
0
Making the session cookie persistent
Searching gmane, I''ve found many discussions on the subject, but never a definitive answer. How can I make the session cookie (i.e., the cookie where rails keeps the session ID) persistent? -- Pazu
2006 Apr 27
15
Which is faster, calling helpers or rendering a partial?
Using partials is a nice way to separate chunks of content into separate pages as opposed to building strings in helpers, but I''m wondering which is faster. It scares me when I see stuff like: Rendered users/_public (0.00051) Rendered users/_public (0.00009) Rendered users/_public (0.00008) Rendered users/_public (0.00008) Rendered users/_public (0.00008) ....50 more times Has anyone
2010 Apr 16
1
cannot set property for ''rpool'': property ''bootfs'' not supported on EFI labeled devices
I am getting the following error, however as you can see below this is a SMI label... cannot set property for ''rpool'': property ''bootfs'' not supported on EFI labeled devices # zpool get bootfs rpool NAME PROPERTY VALUE SOURCE rpool bootfs - default # zpool set bootfs=rpool/ROOT/s10s_u8wos_08a rpool cannot set property for ''rpool'': property
2006 May 03
0
render partial collection passing property
my view contains a call to a partial: <%= render(:partial => ''item_list'', :collection => @keyword.synonyms, :locals => { :action_delete => "removesynonym", and_some_other_stuff }) %> _item_list.rhtml contains: <%= link_to ( image_tag(''/images/deletebutton.png''), { :action => action_delete, :id =>
2006 Apr 22
0
Remove validation for a property
Hi Does anyone here know a way who I could remove the validation for a model''s property? For example, I would like to have in one file: class A < ActiveRecord::Base validates_uniqueness :title end And in another file I want to override or rather remove the validation: class A < ActiveRecord::Base # somehow stop validating :title for uniqueness end The