Re: [Rails] calculating running averages

2011-05-30 Thread Colin Law
On 30 May 2011 04:51, Matt Harrison iwasinnamuk...@genestate.com wrote: I'm working on a community app that allows the residents of a village to log and monitor the traffic going past their houses. There are multiple locations which have many log entries with a traffic count and a time

Re: [Rails] Re: How to use an ActiveRecord plugin in a non-Rails project

2011-05-30 Thread Wael Nasreddine
Hey Josh, Just as a side note, I think it would be more respectful to list all the authors of this gem in your gemspec file Gem::Specification.new do |s| ….. s.authors = ['Joshua Cheek'] ….. end Wael On May 30, 2011, at 2:52 AM, Josh Cheek wrote: On Sat, May 28, 2011 at 7:32 AM, Josh

[Rails] Re: calculating running averages

2011-05-30 Thread Stefano
If you want to have a 'quick' solution to the average problem why not do it like this: a table like: id | number_of_days | total_cars At the end of every day you add +1 to the number of days column and add the number of cars for that day. So as an example after two weeks it would look like this:

[Rails] keeping a controller clean ... how to use a view helper in my controller

2011-05-30 Thread Erwin
there is some case we have to reuse a helper method to produce an html output... in my form view , I am calling a user_helper method fees_string() to output a specific string based on user membership %span#academy_analysis_fees = fees_string( 1, @academy_account_type ) but on changing a

[Rails] Re: keeping a controller clean ... how to use a view helper in my controller

2011-05-30 Thread Tim Shaffer
cannot reuse it in the .js.erb Why not? Seems like that would be the easiest option. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group,

[Rails] Re: Postgresql schemas in migrations and db:schema:dump task

2011-05-30 Thread sleepwalker
Sad(( is here nobody use postgresql with rails? Or I'm asking something wrong? On 18 май, 17:15, sleepwalker krivich.ekater...@gmail.com wrote: Does Rails 3 support native working withpostgresqlschemas, or I should try some own solution? I have some already-createdpostgresqldatabase with 4 or

Re: [Rails] Re: calculating running averages

2011-05-30 Thread Matt Harrison
On Mon, May 30, 2011 at 01:39:26AM -0700, Stefano wrote: If you want to have a 'quick' solution to the average problem why not do it like this: a table like: id | number_of_days | total_cars At the end of every day you add +1 to the number of days column and add the number of cars for

[Rails] Re: keeping a controller clean ... how to use a view helper in my controller

2011-05-30 Thread Erwin
I tried .. but I did it wrong .. ..according to your feedback .. I re-tested .. and it works .. my error : passing the helper method as a variable %= @fees_string( 1, @academy_account_type ) % bad ! I just corrected it : %= fees_string( 1, @academy_account_type ) % and it works ned

Re: [Rails] Ruby on Rails - send_file

2011-05-30 Thread radhames brito
On Fri, May 27, 2011 at 10:00 AM, Sayuj Othayoth li...@ruby-forum.comwrote: I am using the send_file method to download a file. It works fine on my local machine. But it's not working on the server - it returns a blank file. code: send_file Rails.root.join('public', 'uploads') +

[Rails] error of uninitialized constant

2011-05-30 Thread joanne
Hi, I am a new comer with Ruby on Rails and i am trying to create a controller for the model and controller is simple def new @test = Test.new end and model is Rails gernerate model Test name:string title:string and it returns me an error: uninitialized constant TestController::Tests

[Rails] Re: error of uninitialized constant

2011-05-30 Thread Frederick Cheung
On May 30, 4:03 pm, joanne joanne0...@gmail.com wrote: Hi, I am a new comer with Ruby on Rails and i am trying to create a controller for the model and controller is simple def new   @test = Test.new end and model is Rails gernerate model Test name:string title:string and it returns

Re: [Rails] error of uninitialized constant

2011-05-30 Thread Thiago A Pereira
Your controller name is plural? TestsController ? I think your problem is that you not are following this name convention ... Sent from my iPhone On May 30, 2011, at 12:03 PM, joanne joanne0...@gmail.com wrote: Hi, I am a new comer with Ruby on Rails and i am trying to create a controller

Re: [Rails] error of uninitialized constant

2011-05-30 Thread joanne ta
I have no idea about that. However, I am pretty sure that the name of DB is correct and my controller is like this class LanguagesController ApplicationController\ def new @language = Languages.new end end and it points out the problem on new

Re: [Rails] error of uninitialized constant

2011-05-30 Thread Tom Meinlschmidt
@language = Languages.new should be @language = Language.new singular. not plural On May 30, 2011, at 18:29 , joanne ta wrote: I have no idea about that. However, I am pretty sure that the name of DB is correct and my controller is like this class LanguagesController

[Rails] Re: error of uninitialized constant

2011-05-30 Thread joanne
No it is not a plural. On May 30, 11:34 am, Thiago A Pereira thiagoales...@me.com wrote: Your controller name is plural? TestsController ? I think your problem is that you not are following this name convention ... Sent from my iPhone On May 30, 2011, at 12:03 PM, joanne

Re: [Rails] error of uninitialized constant

2011-05-30 Thread joanne ta
Hi, I did try it before as well, it still giving me the same error On Mon, May 30, 2011 at 12:34 PM, Tom Meinlschmidt to...@meinlschmidt.comwrote: @language = Languages.new should be @language = Language.new singular. not plural On May 30, 2011, at 18:29 , joanne ta wrote: I have

[Rails] resetting input radio value in my .js.erb

2011-05-30 Thread Erwin
I need to reset the values of the input radio in my view , via Ajax the view has the following generated html input checked=checked class= id=user_membership_selection_1 name=user[membership_selection] type=radio value=1 /Selected Membership/p input id=user_membership_selection_2

Re: [Rails] error of uninitialized constant

2011-05-30 Thread Tom Meinlschmidt
can you post entire error trace? and code of your model as well tom On May 30, 2011, at 18:49 , joanne ta wrote: Hi, I did try it before as well, it still giving me the same error On Mon, May 30, 2011 at 12:34 PM, Tom Meinlschmidt to...@meinlschmidt.com wrote: @language =

[Rails] Thin vs unicorn vs passenger

2011-05-30 Thread Yiannis
I bought a new server and I was wondering what application server is the best choice for a typical web application with rails. I've thought for a long time that the best choice was apache/nginx and phusion passenger but nowadays I am hearing a lot about thin and unicorn. I have used passenger a

[Rails] Really bad problem with Webrick/Rails using 3.1 - Help?

2011-05-30 Thread egervari
First, I'm probably not going to describe this problem perfectly because I am not entirely sure what it happens - please bear with me. I am getting some weird instability issues with Webrick/Rails 3.1 when I render views that contain my_route_path's that don't actually exist in the ERB file.

Re: [Rails] error of uninitialized constant

2011-05-30 Thread Colin Law
On 30 May 2011 17:29, joanne ta joanne0...@gmail.com wrote: I have no idea about that. However, I am pretty sure that the name of DB is correct and my controller is like this class LanguagesController ApplicationController\ There should be no \ on the end of the line. If this is just a

[Rails] rails habtm checkboxes with jquerymobile

2011-05-30 Thread Federico Rota
Hi guys, I have a habtm association working properly. My application consists of both a desktop and a mobile version. My mobile version is made with jquerymobile and I would like my checkboxes in the edit form to look like the checkboxes shown in

[Rails] [ANN] Rails 3.0.8.rc3 (third time is the charm!)

2011-05-30 Thread Aaron Patterson
Hey everybody! I've pushed Rails 3.0.8.rc3. Hopefully this release candidate takes care of all the outstanding issues remaining. To see what has changed between 3.0.8.rc2 and 3.0.8.rc3, check out [this link on github](https://github.com/rails/rails/compare/v3.0.8.rc2...v3.0.8.rc3). If no

[Rails] Re: Really bad problem with Webrick/Rails using 3.1 - Help?

2011-05-30 Thread egervari
Yeah, I don't think it has anything to do with the asset pipeline - it is definitely a problem with the routes. I made a change on purpose to cause the route to fail, and it causes the effects that I am talking about. Here's some webrick verbiage. Notice that it took 35147ms to complete the

[Rails] Re: Really bad problem with Webrick/Rails using 3.1 - Help?

2011-05-30 Thread egervari
Here's another one: ActionView::Template::Error (undefined local variable or method `edit_user_password' for ##Class:0x0004c829f0: 0x0004c70b60): 51: 52: tr 53: tdPassword:/td 54: td[HIDDEN] (%= link_to Reset Password, edit_user_password %) 55:

[Rails] Modular application design - controller / route setup

2011-05-30 Thread Mickiii
I am fairly new to rails, and have been through a few books, and am now starting to sketch out an application, however I have run into a problem with regards to the structure of the app. I want to build an application that is setup in modules, and examples of urls could be: /Sales - frontpage

Re: [Rails] Modular application design - controller / route setup

2011-05-30 Thread David Kahn
On Mon, May 30, 2011 at 3:26 PM, Mickiii michael.la...@gmail.com wrote: I am fairly new to rails, and have been through a few books, and am now starting to sketch out an application, however I have run into a problem with regards to the structure of the app. I want to build an application

Re: [Rails] rails habtm checkboxes with jquerymobile

2011-05-30 Thread David Kahn
On Mon, May 30, 2011 at 2:47 PM, Federico Rota federico.rot...@gmail.comwrote: Hi guys, I have a habtm association working properly. My application consists of both a desktop and a mobile version. My mobile version is made with jquerymobile and I would like my checkboxes in the edit form to

Re: [Rails] error of uninitialized constant

2011-05-30 Thread joanne ta
I did copy and paste those code. anyway, I did found the way to solve the problem . thanks all :P On Mon, May 30, 2011 at 12:17 PM, Colin Law clan...@googlemail.com wrote: On 30 May 2011 17:29, joanne ta joanne0...@gmail.com wrote: I have no idea about that. However, I am pretty sure that the

[Rails] Re: Really bad problem with Webrick/Rails using 3.1 - Help?

2011-05-30 Thread egervari
I think it's any syntax on the page now. It just happened that routes were my common mistakes before I tested in a browser, but after some more what if tests, I have had this problem come up in other scenarios... so you can ignore my specific errors. The last time this happened, my computer was

Re: [Rails] rails habtm checkboxes with jquerymobile

2011-05-30 Thread Jason Fleetwood-Boldt
On May 30, 2011, at 6:27 PM, David Kahn wrote: div class=ui-field-contain ui-body ui-br data-role=fieldcontain fieldset class=ui-corner-all ui-controlgroup ui-controlgroup-vertical data-role=controlgroup div class=ui-checkbox input id=foo_bar_ids_ type=checkbox value=19

Re: [Rails] rails habtm checkboxes with jquerymobile

2011-05-30 Thread David Kahn
On Mon, May 30, 2011 at 6:27 PM, Jason Fleetwood-Boldt t...@datatravels.com wrote: On May 30, 2011, at 6:27 PM, David Kahn wrote: div class=ui-field-contain ui-body ui-br data-role=fieldcontain fieldset class=ui-corner-all ui-controlgroup ui-controlgroup-vertical data-role=controlgroup

[Rails] Geokit query with multiple models involved

2011-05-30 Thread skt
Hello, My database structure consists of Store, Book, BookStore and Address as below. class Store ActiveRecord::Base has_many :book_stores has_many :books, :through = :book_stores has_many :addresses acts_as_mappable :through = :addresses end class Address ActiveRecord::Base

[Rails] Re: Geokit query with multiple models involved

2011-05-30 Thread skt
Figured it out Store.joins(:books, :addresses).where(books.isbn = '9780316346627').within(5, :origin = @addr) -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To

[Rails][Jobs] Permanent hire in Ottawa

2011-05-30 Thread Long
Anyone in Ottawa (or is relocating to :) Canada looking for a Rails position? Send me a note for more information. Cheers,Long -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to

Re: [Rails] Modular application design - controller / route setup

2011-05-30 Thread Bryan Donovan
I tend to agree with David here. Doing this in a test-driven way will reveal some best practices. That being said, I think you're likely better off not fighting with Rails defaults. So, instead of /Sales, just use /sales. Other routes would be: /sales /sales/customers /sales/customers/123

Re: [Rails] Re: Really bad problem with Webrick/Rails using 3.1 - Help?

2011-05-30 Thread Bryan Donovan
This is the expected behavior, right? There is no method named edit_user_password, so it's raising an error. Why is the route to this resource /trainingdividend/rest/myProfile/editPassword ? And not something like /passwords/edit or something else that is simpler and more Rails-like? Is

[Rails] Calendars in Rails

2011-05-30 Thread Piter Fcbk
Hi all, I'm currently in the need to implement a calendar in rails. It should be able to present a year, month and day view. The events in these 3 views should be able to be opened, on click, to view the information and/or edit it (according to restrictions). The events will belong to users. One