[Rails] jquery rails ajax

2011-05-12 Thread esdevs
so I am using jquery and updating a dom element with $('#thelist').replaceWith(%= escape_javascript(render(:partial = @deals)) %); this works fine except it is not hitting the server so if @deals is updated, it is not refreshing and showing the latest version. My question is how to ajax this

[Rails] Bliptv ruby gem

2009-08-12 Thread esdevs
Does anybody have any experience with this? I am having issues installing it and running config.gem. Getting errors like could not find gem etc when running rake to install it. the two link references are: http://kellysutton.github.com/bliptv/ http://github.com/kellysutton/bliptv/tree/master

[Rails] Re: Ajax Rails

2009-04-08 Thread esdevs
below... %= link_to_function post.title, Element.toggle('div 1') % div id=div 1 style=display: none; %= post.link % /div On Apr 8, 3:23 am, Frederick Cheung frederick.che...@gmail.com wrote: On Apr 8, 5:45 am, esdevs seanpdev...@gmail.com wrote: ok - I am trying to do something seemingly

[Rails] Re: Ajax Rails

2009-04-08 Thread esdevs
never mind - figured it out - the issue was in the div (and made them dynamic through below)...works -- thanks! h3%= link_to_function post.title, Element.toggle('#{post.title}') %/h3 div id=%= post.title % style=display: none; %= post.link % /div On Apr 8, 9:01 am, esdevs seanpdev

[Rails] Re: Ajax Rails

2009-04-08 Thread esdevs
Brilliant on all accounts - thanks guys!! sean On Apr 8, 11:04 am, Frederick Cheung frederick.che...@gmail.com wrote: On 8 Apr 2009, at 15:31, Phlip wrote: div id=%= post.title % style=display: none; Just make sure that %= post.title % is unique for the page. An id must conform to

[Rails] Ajax Rails

2009-04-07 Thread esdevs
ok - I am trying to do something seemingly straight forward. Essentially I want to list out a bunch of items and for each item individually, if the user clicks on it, the corresponding web link will appear underneath -- if the user clicks on the item again, then the weblink disappears. This

[Rails] :order question

2009-03-11 Thread esdevs
ok so I am trying to do something like the below to order by :joins (I know the below won't work)...the only solution that I can fathom is using something like find_by_sql - but I certainly would prefer a simpler method...any suggestions? User.find(:all, :joins = :deals, :group = 'rev',

[Rails] Re: :order question

2009-03-11 Thread esdevs
so to clarify - I am trying to order by the sum of the items in a column in a joined table between a certain date range. On Mar 11, 7:06 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Mar 11, 10:30 pm, esdevs seanpdev...@gmail.com wrote: ok so I am trying to do something like

[Rails] Re: total per user

2009-03-04 Thread esdevs
, which the error suggests is not defined. 2009/3/4 esdevs seanpdev...@gmail.com so I am trying to sum month over month the amount that a user has posted.  So for example: User 1: Jan $3000 Feb $4000 March $1500, etc.  I can get this to work if I sum totals (aggregate of all users) but just

[Rails] Re: total per user

2009-03-04 Thread esdevs
...@googlemail.com wrote: Have you setup relationships between the models, User has many DealGroups and DealGroup belongs to User, or whatever is appropriate. Then you won't need @deal_groups and can use user.deal_groups as you originally wrote. 2009/3/4 esdevs seanpdev...@gmail.com ok so then I am where

[Rails] Re: total per user

2009-03-04 Thread esdevs
of the plethora of tutorials on basic Rails? 2009/3/4 esdevs seanpdev...@gmail.com yes - the relationship is Deals belongs to User and User has many Deals.  So I even changed the code accordingly (from deal_groups to deals) per below...what's wierd is that now I am getting an error

[Rails] Re: total per user

2009-03-04 Thread esdevs
insight On Mar 4, 5:23 pm, Colin Law clan...@googlemail.com wrote: 2009/3/4 esdevs seanpdev...@gmail.com objecting to user.deals.keys so yeah if I switch things up (and not iterate but rather define @user as User.find(:first).  It works great for the first user in the array perfectly

[Rails] Re: total per user

2009-03-04 Thread esdevs
') # = 4562 Cheers, Robby On Wed, Mar 4, 2009 at 3:42 PM, esdevs seanpdev...@gmail.com wrote: right - so I could do something like % for user in @users% %= user.deals.collect(:rev).sum% % end % which gives the total sum of deals (but not yet iterated through months which