[Rails] Ruby On Rails Getting Started question

2013-12-03 Thread Eric Blow
Hi All, I am going through the getting started guide here http://guides.rubyonrails.org/getting_started.html And in section 5.7 it refers to a code snippet that I don't understand what to do with it. post GET/posts/:id(.:format) posts#show I don't understand if I am supposed to put

[Rails] Re: Controller function - Length

2013-12-03 Thread psahni
As we say in rails skinny controllers, fat models. Ideally most of the business logic, all database interactions should go to model, becz model is meant to do it. controller methods should only contain request and response code, so that it is easy to test. Regards On Monday, 2 December 2013

[Rails] Re: Please can Someone help me install Fedena School system on my cpanel...

2013-12-03 Thread Abdulla Hisham
As Colin mentioned, already there are lot of good posts,articles,discussions good enough to handle most of the installations and other related queries. Incase if you don't find it anywhere, we/community would look into the same and do the needful. We want it to grow organically so we would

[Rails] Rails won't install

2013-12-03 Thread VP
Hi folks. ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13] Rails won’t install: Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem native extension.

Re: [Rails] Rails won't install

2013-12-03 Thread Jordon Bedwell
On Mon, Dec 2, 2013 at 11:18 AM, VP li...@viaduct-productions.com wrote: ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13] Rails won’t install: Building native extensions. This could take a while... ERROR: Error installing rails: ERROR: Failed to build gem

Re: [Rails] Ruby On Rails Getting Started question

2013-12-03 Thread Jordon Bedwell
On Sun, Dec 1, 2013 at 4:54 PM, Eric Blow ericb...@gmail.com wrote: Hi All, I am going through the getting started guide here http://guides.rubyonrails.org/getting_started.html And in section 5.7 it refers to a code snippet that I don't understand what to do with it. post GET

Re: [Rails] Ruby On Rails Getting Started question

2013-12-03 Thread Colin Law
On 1 December 2013 22:54, Eric Blow ericb...@gmail.com wrote: Hi All, I am going through the getting started guide here http://guides.rubyonrails.org/getting_started.html And in section 5.7 it refers to a code snippet that I don't understand what to do with it. post GET

[Rails] Re: state_machine prevents ActiveRecord from being persisted

2013-12-03 Thread climber
Hello, I also has this problem, I need to create an AuditTrail instance in db even if the transition is failed, but if the transition failed, the transaction is rollback, and the failed AuditTrail instance is not created in database. On Wednesday, January 27, 2010 12:55:46 PM UTC+8, FFighter

[Rails] How to send other params with rails3-jquery-autocomplete

2013-12-03 Thread vijay c.
I want to send other params i.e hidden field values in `get_autocomplete_items(parameters)` and I tried = rec.autocomplete_field :name, autocomplete_recruiter_name_job_applications_path, :placeholder=Recruiter name,:id_element=#phone, :param_name = 'search' But ajax request is sending by

[Rails] Anybody interested in reviewing Packts first book on HAML ?

2013-12-03 Thread Sandy Joseph
We have a limited e-copies of the book available for review. If interested in reviewing the book Instant Hamlhttp://www.packtpub.com/integrate-haml-into-current-application-setup-and-development-workflow/book within 7-10 days of receiving the digital copy?? Please the follow the steps below

[Rails] Link posts and comments on a new view/controller

2013-12-03 Thread phil...@bailey.st
Hello everyone, I'm a newbie following the http://guides.rubyonrails.org/getting_started.html , so far everyone is working without problems except a modification that I made earlier. I've created a view called welcome that act as main content page where I list all the posts, going a bit

[Rails] Question about collection_check_box

2013-12-03 Thread Ronny Fauth
Hi there, i want to use collection_check_boxes (in rails 4) but i am a little bit stuck... okay, first things first: i have 2 models: class Supervisioncategory ActiveRecord::Base has_many :phonenotes end and class Phonenote

Re: [Rails] Question about collection_check_box

2013-12-03 Thread Walter Lee Davis
On Dec 3, 2013, at 12:18 PM, Ronny Fauth wrote: Hi there, i want to use collection_check_boxes (in rails 4) but i am a little bit stuck... okay, first things first: i have 2 models: class Supervisioncategory ActiveRecord::Base has_many :phonenotes end

[Rails] Is it possible to serialize the query builder data part of ActiveRecord::Relation and use it later

2013-12-03 Thread Anton Kuzmin
Is it possible to serialize the query builder data part of ActiveRecord::Relation and use it later to query the database with exactly the same query? to_sql is not suitable My task is to have reload a div that contains a list of records got from DB. It can be taken from DB via simple search,

Re: [Rails] Question about collection_check_box

2013-12-03 Thread Ronny Fauth
Am 2013-12-03 18:42, schrieb Walter Lee Davis: View source as generated by Rails in your browser, and see what these checkboxes look like in HTML. That's where I would start debugging this. My guess is that you need these to be supervisioncategory_ids, since that's what the b/t is saying the

Re: [Rails] Question about collection_check_box

2013-12-03 Thread Walter Lee Davis
On Dec 3, 2013, at 12:49 PM, Ronny Fauth wrote: Am 2013-12-03 18:42, schrieb Walter Lee Davis: View source as generated by Rails in your browser, and see what these checkboxes look like in HTML. That's where I would start debugging this. My guess is that you need these to be

Re: [Rails] Question about collection_check_box

2013-12-03 Thread Ronny Fauth
Am 2013-12-03 19:26, schrieb Walter Lee Davis: Okay, that looks right, as far as it goes. Now what happens in your console if you find a phonenote, and ask for its supervisions? p = Phonenote.first p.supervisions # error, or array? 2.0.0-p353 :002 p.supervisions

Re: [Rails] Question about collection_check_box

2013-12-03 Thread Ronny Fauth
Am 2013-12-03 19:46, schrieb Ronny Fauth: Am 2013-12-03 19:26, schrieb Walter Lee Davis: Okay, that looks right, as far as it goes. Now what happens in your console if you find a phonenote, and ask for its supervisions? p = Phonenote.first p.supervisions # error, or

[Rails] [ANN] Rails 3.2.16 and 4.0.2 have been released

2013-12-03 Thread Aaron Patterson
Hi everyone! Rails 3.2.16 and 4.0.2 have been released! These two releases contain important security fixes, so please upgrade as soon as possible! In order to make upgrading as smooth as possible, we've only included commits directly related to each security issue. The security fixes in

[Rails] chaining relations break?

2013-12-03 Thread Fearless Fool
The following works: r = u.utility_data.select(utility_id, sum(ami_residential)).group(utility_id) = #ActiveRecord::Relation [#UtilityDatum id: nil, utility_id: 5621] r.first[:sum] = 263 but when written as a one-liner: u.utility_data.select(utility_id,

[Rails] Re: chaining relations break?

2013-12-03 Thread Fearless Fool
BTW, I also tried this: UtilityDatum. select(sum(ami_residential)). where(:utility = u). group(utility_id). unscope(:order, :limit). first ... but that still tacks on ORDER BY and LIMIT clauses to the query, so it still fails. Evidently I don't understand unscope(). -- Posted via

Re: [Rails] Link posts and comments on a new view/controller

2013-12-03 Thread phil...@bailey.st
Just sorted out using Nested Eager Loading. % post.comments.each do |comment| % td%= comment.commenter %/td td%= comment.body %/td On 03/12/13 16:23, phil...@bailey.st wrote: Hello everyone, I'm a newbie following the

[Rails] rails and passenger memory issues

2013-12-03 Thread John Merlino
I'm using Rails 3, Passenger, and Postgresql. Yesterday the rails application was running very slow. So I rebooted the server. Less than 24 hours later, it is consuming even more memory than before and when trying to load the web page, it just hangs forever. I ran passenger-memory-stats to

[Rails] Re: ruby script if statement

2013-12-03 Thread yinwen Xuan
Scott Ribe wrote in post #1129304: On Dec 2, 2013, at 8:43 PM, yinwen Xuan li...@ruby-forum.com wrote: but the result is all showing sq feet, any idea, sorry I don't know where else I can work it out. You're very close, but spelling matters. Review my prior message to you. -- Scott Ribe

Re: [Rails] ruby script if statement

2013-12-03 Thread Scott Ribe
On Dec 3, 2013, at 6:08 PM, yinwen Xuan li...@ruby-forum.com wrote: Sorry Scott, All fixed now. you are a good teacher!! let me know if you want student, I am happy to pay tuition ;-) I'm glad it's working. One last thing, regarding people who told you to move this from view to controller,

[Rails] Re: Integration of barcode Scanner or Reader into Application

2013-12-03 Thread Dsad D.
An image barcode reader can be integrate within .NET Framework in any programming language, such as, C#.NET, VB.NET, ASP.NET and .NET Windows Forms with any Visual Studio Version. http://www.rasteredge.com/dotnet-imaging/addon-barcode-reader/ -- Posted via http://www.ruby-forum.com/. -- You

Re: [Rails] state_machine prevents ActiveRecord from being persisted

2013-12-03 Thread Rick
It sounds like you're in a tangle between FSM states and ActiveRecord states. You might need to add a payment_queued state that forces an AR save before transitioning to do_pay. You could then add some logic that fires a loop back to through do_pay (retry n times after increasing timeout)