[Rails] WebApps Conference: Meet Web Application Experts from Sapient, Adobe,Wipro and others!(April 9th,2011) @ Delhi.
Hi , SiliconIndia is organizing WebApps 2011 in Delhi on April 9th, 2011. Drawing well-renowned thought-leaders, contributors, influencer's, and organizations in the Web Development space, the conference offers insight to develop industry-leading Web Development projects. The conference brings together web developers, web designers technology enthusiasts, innovators, vendors, and users to experience the future of Web Applications. Web-based applications are revolutionizing both the features that can be delivered and the technologies for developing and deploying applications. They also involve a diverse collection of issues and technologies.We have lined up some of the best speakers and the sessions networking will be of the highest order.Get hands-on technical training and gain new skills. WebApps 2011 guarantees perfect networking and exciting learning success in workshops, sessions, discussion panels fascinating keynotes. TOPICS: • An optimum approach to n-tier architectured application testing • Lessons learned in developing Web applications • Powerful Tools that You Need (and probably don't know about) • Guidelines and best practices: Architecture of web applications • eCommerce web app Architecture and Scalability • Developing secure and high performance web applications • Situation Normal, Everything Must Change • Performance Engineering for WebApps Confirmed Speakers: Ajey Gore, Head of Technology, Thought Works Uday M Shankar, Principal Engineer, Yahoo Ganesh Sahai, Quality Manager Quality Leader , Adobe Vivek Merani, Senior Vice President , Magnon International Deepak Arora, Director Technology, Sapient Nitro Prashant Gautam, Project Lead-Performance Engineering Practice, Wipro Technologies Tarun Dua, CTO, E2E Networks Nishit Shrivastava, Technical Architect, Sify Who should attend: Web Application Developers, Application Managers, Web Architects, Web and Graphic Designers, Web Development Managers, Web Strategists, Web Technologists, Business Strategists, E-commerce Managers, Product Managers, Technologists and Entrepreneurs and Others DATE: April 9th, 2011(Saturday) TIME: 8.30 AM to 6:00 PM VENUE: PHD Chamber of Commerce Industry PHD House, 4/2 Siri Institutional Area, August Kranti Marg, New Delhi - 110016 We have limited Seats. Registration for this game-changing Symposium is by invitation only. Attendance is limited to maintain an intimate setting and foster dialogue among all participants. REGISTER @ : http://bit.ly/WebApDelhigoogle LOOKING FORWARD TO HEAR FROM YOU. And also you can NOMINATE your colleagues and friends who ever is interested in attending this event. There will be a registration fee of Rs 500/- only. This is towards: Access to Sessions, Tea/ Coffee Refreshments and Lunch. Here's your chance to meet tech leaders and get expert instruction and hands-on tutorials to create the best web applications, tools, and software. Thanks SiliconIndia -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Will Paginate
On Mar 28, 5:44 am, Jeffrey Bonson li...@ruby-forum.com wrote: My problem is the div is not getting updated, like the way, a link_to_remote would have worked. I am able to see all the div commands and the expected data in a simple white screen after the second pagination click. Am i missing a simple coding here? Please help !!! will_paginate doesn't generate ajax links by default. You can write a custom link renderer that does however (I think there are a few examples floating around of how to do this) Fred -- Posted viahttp://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Help me! The Rails wiki's domain that url is wiki.rubyonrails.org is removed!
I'm Japanese Ruby Programmer. I can't see The Rails wiki. The Rails wiki is very important for Japanese Rails programmer because this site was rare site to written in Japanese language. Please help me this situation. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: RoR with integrated windows authentication
Hey Alpha, As radhames brito pointed out, you can use a plug-in for LDAP authentication with Devise (a popular authentication system) to facilitate authentication with ActiveDirectory. I had to build a few systems like this a couple years ago, and at the time all I had available was a simple LDAP gem to facilitate communication. From an overview perspective, it's pretty simple. Your web application can accept username/password parameters, then ask your AD server to authenticate that user via a standard LDAP connection using a gem like ruby-net-ldap. The server responds, and your application can act accordingly. Implementation-wise, AD is Microsoft's LDAP system; you can interface with it pretty-much just like any other LDAP server, though I believe it has some unique qualities that make it a little bit special. One tool I found absolutely invaluable when doing this before was Apache's LDAP tool, Apache Directory Studio - http://directory.apache.org/. It can form a connection to your AD server and let you discover all the hidden properties of tree nodes that Microsoft's built-in AD browser won't tell you. You may need that when figuring out which tree to use when authenticating users (depending on how your LDAP setup works) or other potentially valuable items stored therein. Unfortunately, I can't comment on how Devise does LDAP authentication as I haven't used it before (I don't think it existed at the time I had to build the equivalent a few years back). I'd recommend trying to use it first, and if you can't quite get that working, you can go deep dive and brew your own. Generally speaking though, using a standardized and properly maintained authentication system like Devise is a better way to go, so I'd recommend that approach starting out. I hope this helps you at least get an idea of where to start. Good luck! On Mar 27, 9:19 pm, Alpha Blue li...@ruby-forum.com wrote: Hi All, I'm taking on a re-write project for a ticketing system solution and my company uses ASP.net with IIS. I want to build the new ticketing system with Rails as I believe it to be a much cleaner long term solution, and add to that I don't care for ASP and how it handles sessions. I've searched long and hard and a lot of posts and information out there are pretty out dated in terms of NTLM or (integrated windows authentication) as it's now called working with Rails. I will not be using IIS thankfully and would rather go an Apache route with a mod to handle initial authentication through windows active directory. We use IE8 and it should pass through perfectly. But, I need to know what I'm getting into and would like to look over as many resources as possible before I fully commit to this project. So, with that said, what resources am I going to need to work on this? I'm fully familiar with Ruby 1.8.7, 1.9.1, and 1.9.2 and Rails version 2.x and 3.x, including rails 3.1. I normally use apache + passenger + rails when going to production on a linux server. How would you approach this and what pieces would you opt for, given this scenario? And, any updated links on where to go with this? Thanks for your time. -- Posted viahttp://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Set bounce address with ActionMailer::ARMailer
Frederick Cheung wrote in post #987560: On Mar 15, 2:34pm, Max Williams li...@ruby-forum.com wrote: Hi all. I send out mails using ActionMailer::ARMailer, via an exim mailserver. Is there some header/field that i can set so that the reply field is (eg) webmas...@ourdomain.com but bounced (ie undeliverable) mails get sent back to (eg) nore...@ourdomain.com? isn't that the difference between return-path and reply-to ? Fred Hi fred - i'm not sure what you mean. Do you mean i should be setting reply-to (or is it Reply-To?) to nore...@charanga.com as well? Or instead of Return-Path? -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Set bounce address with ActionMailer::ARMailer
On Mar 28, 9:43 am, Max Williams li...@ruby-forum.com wrote: Frederick Cheung wrote in post #987560: On Mar 15, 2:34pm, Max Williams li...@ruby-forum.com wrote: Hi all. I send out mails using ActionMailer::ARMailer, via an exim mailserver. Is there some header/field that i can set so that the reply field is (eg) webmas...@ourdomain.com but bounced (ie undeliverable) mails get sent back to (eg) nore...@ourdomain.com? isn't that the difference between return-path and reply-to ? Fred Hi fred - i'm not sure what you mean. Do you mean i should be setting reply-to (or is it Reply-To?) to nore...@charanga.com as well? Or instead of Return-Path? it was my understanding that reply-to is what gets used when the user tries to reply to one of your emails, but that return-path is used for bounces (I may of course be wrong) Fred -- Posted viahttp://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] New here. Trying to integrate databases. Netbeans??
Hi folks, I'm new to RoR development, but highly enthused! I'm often confused by all the options and commands associated with accessing databases. I tried RoR using Netbeans 7, with the Rails plugin installed, but found that only compounded the confusion. Does anyone use Netbeans for RoR? Can anyone help me connect to my MySQL db? Much thanks! Joel -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] New here. Trying to integrate databases. Netbeans??
On 28 March 2011 07:17, Joel joel.wes...@gmail.com wrote: Hi folks, I'm new to RoR development, but highly enthused! I'm often confused by all the options and commands associated with accessing databases. I tried RoR using Netbeans 7, with the Rails plugin installed, but found that only compounded the confusion. Does anyone use Netbeans for RoR? Can anyone help me connect to my MySQL db? I would advise against trying to use Netbeans though some disagree. Just use a good editor and use the console for commands. What stage have you got to? Have you managed to install rails and create an application? See the Rails Guide on getting started if you have not got that far. Colin -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Set bounce address with ActionMailer::ARMailer
Frederick Cheung wrote in post #989568: On Mar 28, 9:43am, Max Williams li...@ruby-forum.com wrote: Fred Hi fred - i'm not sure what you mean. Do you mean i should be setting reply-to (or is it Reply-To?) to nore...@charanga.com as well? Or instead of Return-Path? it was my understanding that reply-to is what gets used when the user tries to reply to one of your emails, but that return-path is used for bounces (I may of course be wrong) Fred That's what i thought, but it's not working for me: currently i'm doing this 'From' = webmas...@ourdomain.com 'Return-Path' = nore...@ourdomain.com 'To' = lkajsdkjhkljshdkljhsdflkjhkljhkljhlkjls...@gmail.com This should get bounced back by gmail, and i'd think it would get bounced back to the noreply address. But, the noreply mailbox doesn't get anything back. -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Set bounce address with ActionMailer::ARMailer
On Mar 28, 11:12 am, Max Williams li...@ruby-forum.com wrote: Frederick Cheung wrote in post #989568: On Mar 28, 9:43am, Max Williams li...@ruby-forum.com wrote: Fred Hi fred - i'm not sure what you mean. Do you mean i should be setting reply-to (or is it Reply-To?) to nore...@charanga.com as well? Or instead of Return-Path? it was my understanding that reply-to is what gets used when the user tries to reply to one of your emails, but that return-path is used for bounces (I may of course be wrong) Fred That's what i thought, but it's not working for me: currently i'm doing this 'From' = webmas...@ourdomain.com 'Return-Path' = nore...@ourdomain.com 'To' = lkajsdkjhkljshdkljhsdflkjhkljhkljhlkjls...@gmail.com This should get bounced back by gmail, and i'd think it would get bounced back to the noreply address. But, the noreply mailbox doesn't get anything back. Make sure that nothing is overwriting your Return-Path, I've come across mail servers that would rewrite that sort of stuff for you. (eg send a mail to an address you can read and check that the return path is the one you specified) Fred -- Posted viahttp://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Possible controllers for Rails 3
Hi, I am currently upgrading my Rails 2.3.8 app to Rails 3.0.5. For an internal lib I use ActionController::Routing::possible_controllers but unfortunately it is not available anymore. Does anyone know how to retrieve the same piece of information with Rails 3 ? Cheers Alex -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] will_paginate with multiple params
Hi, This is Mathew vivek A I am facing some problems using will_paginate for multiple params Can anyone explain me in detail My code is : %= will_paginate @areas,:params = {:field_officer = params[:field_officer],:branch = params[:branch]}% -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
RE: [Rails] will_paginate with multiple params
-Original Message- From: Mathew Vivek Sent: 28/03/2011 3:55:08 pm Subject: [Rails] will_paginate with multiple params Hi, This is Mathew vivek A I am facing some problems using will_paginate for multiple params Can anyone explain me in detail My code is : %= will_paginate @areas,:params = {:field_officer = params[:field_officer],:branch = params[:branch]}% What problems are you facing?? post the error here -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Help me! The Rails wiki's domain that url is wiki.rubyonrails.org is removed!
On Mar 28, 8:28 am, masaki ando ando.la...@gmail.com wrote: I'm Japanese Ruby Programmer. I can't see The Rails wiki. The Rails wiki is very important for Japanese Rails programmer because this site was rare site to written in Japanese language. Please help me this situation. According to http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/54934788d12b67e1/5bbf1b0ee6718941? it's gone for ever. Fred -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Translate (internationalize) entire pages - best practice?
Stefano wrote in post #986389: Is it a good idea to store entire pages so possibly a lot of text in a redis database or key driven storage? Or is it more to translate little stuff like buttons, links, etc. Hi Stefano, just curious about the outcome at your side, what solution did you end up deploying? -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: undefined method `start_form_tag'
Colin Law Thanks for reply.I am using rails version 2.3.8.Is this reason for getting the error? The link which you suggessted for tutorials provide stuff paid!Is there any good free tutorials for RoR? Thanks -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Not geeing the reply by mail
I had done a mail to this group regarding my problem but not getting reply by the mail even the guest are replying to post.The post with replies is at http://www.ruby-forum.com/topic/1371088 Why not receiving the mail for this group? Thanks -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: RoR with integrated windows authentication
Thanks for the input guys. I didn't realize that devise had ldap authentication built in. I'll take a look at that and also will look at Apache Directory Studio. I appreciate the tips and links. -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Set bounce address with ActionMailer::ARMailer
Frederick Cheung wrote in post #989578: Make sure that nothing is overwriting your Return-Path, I've come across mail servers that would rewrite that sort of stuff for you. (eg send a mail to an address you can read and check that the return path is the one you specified) Ok, i just stripped out any extra headers (so i'm just setting to, from, subject, and body) and then sent a mail with the from field set to my yahoo email and the from field set to my gmail email. Changing the addresses to protect the innocent, let's say that i set it up as follows: From: my-yahoo-addr...@yahoo.co.uk To: my-gmail-addr...@gmail.com Subject: Hello dummy Body: Hello dummy\n So, i sent that out, recieved it in gmail and inspected it, to see the following: Delivered-To: my-gmail-addr...@gmail.com Received: by 10.52.156.164 with SMTP id wf4cs20192vdb; Mon, 28 Mar 2011 05:29:27 -0700 (PDT) Received: by 10.227.163.133 with SMTP id a5mr3664403wby.73.1301315366670; Mon, 28 Mar 2011 05:29:26 -0700 (PDT) Return-Path: my-yahoo-addr...@yahoo.co.uk Received: from uk1w2c0067.eechost.net (uk1w2c0067.eechost.net [217.69.46.42]) by mx.google.com with ESMTP id u2si6545764wbd.60.2011.03.28.05.29.26; Mon, 28 Mar 2011 05:29:26 -0700 (PDT) Received-SPF: neutral (google.com: 217.69.46.42 is neither permitted nor denied by best guess record for domain of my-yahoo-addr...@yahoo.co.uk) client-ip=217.69.46.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 217.69.46.42 is neither permitted nor denied by best guess record for domain of my-yahoo-addr...@yahoo.co.uk) smtp.mail=my-yahoo-addr...@yahoo.co.uk Received: from ec2 ([75.101.135.251]) by uk1w2c0067.eechost.net with Microsoft SMTPSVC(6.0.3790.4675); Mon, 28 Mar 2011 13:30:03 +0100 Received: from localhost ([127.0.0.1] helo=ir.charanga.com) by ec2 with esmtp (Exim 4.63) (envelope-from my-yahoo-addr...@yahoo.co.uk) id 1Q4BZV-00032m-Fq for my-gmail-addr...@gmail.com; Mon, 28 Mar 2011 13:29:25 +0100 Date: Mon, 28 Mar 2011 13:28:39 +0100 From: my-yahoo-addr...@yahoo.co.uk To: Dummy User my-gmail-addr...@gmail.com Subject: Hello dummy Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-Id: E1Q4BZV-00032m-Fq@ec2 Return-Path: my-yahoo-addr...@yahoo.co.uk X-OriginalArrivalTime: 28 Mar 2011 12:30:03.0500 (UTC) FILETIME=[DCE862C0:01CBED43] Hello dummy I tried again, setting the 'Return-Path' header when building the email, but the Return-Path header in the received mail is still set to be the same as the from address. -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: undefined method `start_form_tag'
On 28 March 2011 13:02, amritpal p. li...@ruby-forum.com wrote: Colin Law Thanks for reply.I am using rails version 2.3.8.Is this reason for getting the error? As Bryan said those were deprecated and presumably are now no longer there, so yes I expect so. The link which you suggessted for tutorials provide stuff paid!Is there any good free tutorials for RoR? It is free to use online (rather than downloading complete tutorial). Click in the first paragraph of railstutorial.org where it says 'available for free online'. I suggest you upgrade to Rails 3 first though. There is no point starting with an out of date version (2.3.8) unless you need to maintain legacy code. Colin -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Not geeing the reply by mail
On 28 March 2011 13:08, amritpal pathak amritpalpath...@gmail.com wrote: I had done a mail to this group regarding my problem but not getting reply by the mail even the guest are replying to post.The post with replies is at http://www.ruby-forum.com/topic/1371088 Why not receiving the mail for this group? Have you subscribed to the list at http://groups.google.com/group/rubyonrails-talk? Colin -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Clear text field with a button
Hi all, I want to clear a text field by pressing a button, I get it work using Javascript but I want to know if there's a Rails way to do it. Thanks, Nahuel. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: RoR with integrated windows authentication
On Mon, Mar 28, 2011 at 8:16 AM, Alpha Blue li...@ruby-forum.com wrote: Thanks for the input guys. I didn't realize that devise had ldap authentication built in. I'll take a look at that and also will look at Apache Directory Studio. Is not build in, you have to another gem to it, is a plugin -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Set bounce address with ActionMailer::ARMailer
On Mar 28, 1:52 pm, Max Williams li...@ruby-forum.com wrote: Hello dummy I tried again, setting the 'Return-Path' header when building the email, but the Return-Path header in the received mail is still set to be the same as the from address. Yahoo may be forcing the return path (eg so that you can't spam people by sending email you know will bounce and setting the return-path to be the victim's email address, thus getting someone else's mail server to send the spam message) Fred -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Token Poken :( I'm stuck with this
Hay all! I have question-answer base.. like quiz, yeah? yes! So i need to do this way... my project without registration so this way i need token.. user can answer on my question only once.. How can i do this? Iand i can give him link, and link should be like : localhost:3000/token .. he gets on this link, answer and click go and that's all. If he want to get on this page once again he will get message something like Sorry bro you already passed quiz. #answer_controller.rb class AnsweController ApplicationController layout default $all_questions_archive = Question.count('id') $all_questions_active = Question.find(:all,:conditions=enabled=1).count def create @w1 = rand(999) @w = Digest::SHA1.hexdigest(@w1.to_s) @answers=Hash.new questions = Question.find(:all,:conditions=enabled=1) questions.each do |question| if params[answer_+question.id.to_s] @answers[question.id]=params[answer_+question.id.to_s] if !Answer.create(:question_id=question.id,:token=@w,:text=params[answer_+question.id.to_s]) flash[:error]=Can`t create answer! end end end if !flash[:error] redirect_to :action=pass return false end end def index @answers=Hash.new @questions = Question.find(:all,:conditions=enabled=1) end def pass flash[:notice]=span id='ty'Thank you for your answers!/span render :text=, :layout=ty end #view = index.html.erb % form_tag :action=create do % table border=0 width=900px align=center style=background:#e1e3e3; padding-top:10px;padding-left:20px;padding-right:20px;padding-bottom:20px; % @questions.each_with_index do |question, index| % tr style=vertical-align:middle; text-align:left; td width=400px colspan=2 style=padding-top:10px; span style=font-size:15px%= index+1 %. %= question.text %/spanbr %= text_area_tag answer_#{question.id},@answers[question.id], :cols=90, :rows=4, :class = 'inputBox' % /td /tr % end % /table table border=0 width=900px align=center class=table2 tr td align=right%= submit_tag 'Pass survey rarr;', :class = 'submit'%/td /tr tr %=h @w % /tr /table % end % What did i do wrong? Please help m,e! -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: New here. Trying to integrate databases. Netbeans??
I second Colin not to go with Netbeans. Just take a good editor, for example Textmate on Mac. You do not provide much information on your current level or your concrete problem, therefore just a few links: - http://guides.rubyonrails.org - http://ruby.railstutorial.org/ruby-on-rails-tutorial-book - http://rails-nutshell.labs.oreilly.com/index.html - http://www.communityguides.eu (my own site) Markus On Monday, March 28, 2011 8:17:52 AM UTC+2, Joel wrote: Hi folks, I'm new to RoR development, but highly enthused! I'm often confused by all the options and commands associated with accessing databases. I tried RoR using Netbeans 7, with the Rails plugin installed, but found that only compounded the confusion. Does anyone use Netbeans for RoR? Can anyone help me connect to my MySQL db? Much thanks! Joel -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: How to deserialize an array from XML
On Mar 27, 10:18 am, pepe p...@betterrpg.com wrote: On Mar 26, 1:24 pm, Gustavo de Sá Carvalho Honorato gustavohonor...@gmail.com wrote: Hi, to serialize an array to xml we can use: an_array = [ 1, 2, 3] an_array.to_xml But to I can't find a way to convert back XML to array. I didn't find a method Array.from_xml like Hash.from_xml. Any ideas? I have never done what you are trying but I know there is a way of converting a hash to an array (http://ruby-doc.org/core/classes/ Hash.html#M000722) so you could do a double conversion. If you need a simple array then you could just flatten the resulting array of arrays. I have looked again at this and I actually couldn't find a 'to_xml' method for Array or for anything else in Ruby. The method exists in Rails, though but for ActiveRecord instances, though, not for arrays. If what you are trying to do is converting a model instance to xml and backthis is how you could do: # Converting to XML my_model_instance = MyModel.find my_id xml = my_model_instance.to_xml # Generating instance from XML my_new_model = MyModel.new my_new_model.from_xml xml -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Changing default date format in Rails
Use Rails I18n for this. In config/locales/en.yml: en: date: formats: default: %m/%d/%Y In views: %= l some_model.date_field % -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Clear text field with a button
There isn't a Rails way to do it. That's a job for JavaScript, as you have already found. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] how to use ruby mine
i installed ruby mine 3.0.1 version., installed gems cucumber need to use cucumber and ruby with rubymine can u guide me for that thanks sri -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Set bounce address with ActionMailer::ARMailer
Frederick Cheung wrote in post #989604: On Mar 28, 1:52pm, Max Williams li...@ruby-forum.com wrote: Hello dummy I tried again, setting the 'Return-Path' header when building the email, but the Return-Path header in the received mail is still set to be the same as the from address. Yahoo may be forcing the return path (eg so that you can't spam people by sending email you know will bounce and setting the return-path to be the victim's email address, thus getting someone else's mail server to send the spam message) Fred ah...in that case (assuming other mail servers will do the same thing) then i'm screwed, right? As far as having a bounce address which is different to the from address goes anyway. -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] how to use ruby mine
Rubymine has its own mailing list: http://devnet.jetbrains.net/community/ruby And the newest version is 3.1, so the first thing I'd do is get the latest version and try with that. On Mon, Mar 28, 2011 at 10:53 AM, Srinivas Golyalla golya...@gmail.com wrote: i installed ruby mine 3.0.1 version., installed gems cucumber need to use cucumber and ruby with rubymine can u guide me for that thanks sri -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Rotating logs in Rails 3
It looks like there are two accepted ways of rotating log files on production, but most of the discussion I've found is a couple years old. Does anyone have an opinion on which of these methods is better for a Rails 3 app on CentOS? Which method are you using and what are the drawbacks of it? 1) Inside of Rails: In config/environments/production.rb, put in something like this line: config.logger = Logger.new(config.log_path, 50, 1.megabyte) 2) Using logrotate: create the file /etc/logrotate.d/passenger and put something like this in it: /home/deploy/app/shared/log/*.log { daily missingok rotate 30 compress delaycompress sharedscripts postrotate touch /home/deploy/app/current/tmp/restart.txt endscript } Thanks! -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: shared primary key (using the primary key as a foreign key for has_one association)
It is indeed redundant to have both #set_primary_key and the :primary_keyoption w/in your #has_many (or #has_one) calls. You can safely ignore that aspect of my prior posts :). The real code I yanked my examples from actually has a table with a primary key named ID (so set_primary_key ID) but has another column UserID (that is also unique and *could* have been the primary key instead; crazy old db) that for all relationships is treated as if it were the primary key. So, in reality my model is more like this: class User ActiveRecord::Base set_table_name tblUser set_primary_key ID has_many :comments, :primary_key = UserID, :foreign_key = PosterID end That's what I get for not simply copy/pasting (then nuking irrelevant details) and hand-coding my example from memory. Anyhow, your other observation is also dead on. Creating an association on a model doesn't require you to create the inverse association on the other model. P.S. the reason i am torturing Rails like that is that it also has a convention that it should obey the human. Seriously, i just want a nice and clear structure of my database, which would be editable by hand (it is not going to be big), and to use Rails just for a simple interface. While I always follow rails conventions when possible (and recommend others do too), I also like to torture frameworks to see how flexible they are. After all, there are always occasions where it becomes necessary, such as in my instance where I have to work off of a legacy database that is still concurrently being accessed by legacy software. On the side, however, I've instantiated a dozen smaller toy or utility rails apps where I've followed the conventions and idioms religiously to great effect. Love 'em. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Rotating logs in Rails 3
Okay, I'll bite and give my $0.02. Method #1 Pros and Cons: Con: I don't like the application code to be responsible for log rotations. It feels like this should be a system administrative task. Pro: Easy to set up and no need to drop a logrotate config in /etc on deployment Method #2 Con: Deployment requires another external step (configuration external to the application code itself) Pro: From a sysadmin point of view, I keep all my log rotation configuration in one place (as it ought to be). My Preference Method #2: use capistrano or other scripted/automated deployment tool to drop (or update) a logrotate config in your /etc/logrotate.d/ directory to overcome the downside of this method and you're golden. That's just my opinion. I'd also be interested in other points of view and better ideas. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Rails 2 Question
Hey guys. I got a project that is running on Rails 2.3.5 on ruby 1.8.6. I am used to working with rails 3.0 where, when I get the codebase, I use bundler to install my gems, as per declared in the gemfile. What was the predecessor to bundler? Is there a way to quickly set up my environment. And where is the gemfile...all I see if a few gems listed in the environment.rb file? Any help would be greatly appreciated. Thank you! -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Rails 2 Question
Hi, What was the predecessor to bundler? The gems were declared in environment.rb like the ones you saw. Is there a way to quickly set up my environment. And where is the gemfile...all I see if a few gems listed in the environment.rb file? I recommend you use bundler for Rails 2.3.x apps : http://gembundler.com/rails23.html Hope it helps. Alex -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Rotating logs in Rails 3
Okay, I'll bite and give my $0.02. Method #1 Pros and Cons: Con: I don't like the application code to be responsible for log rotations. It feels like this should be a system administrative task. Pro: Easy to set up and no need to drop a logrotate config in /etc on deployment Agreed... Method #2 Con: Deployment requires another external step (configuration external to the application code itself) Pro: From a sysadmin point of view, I keep all my log rotation configuration in one place (as it ought to be). My Preference Method #2: use capistrano or other scripted/automated deployment tool to drop (or update) a logrotate config in your /etc/logrotate.d/ directory to overcome the downside of this method and you're golden. One drawback to this is /etc/logrotate.d is usually owned by root... do you want capistrano to be able to write to root protected directories? That opens a door for someone to put in a postrotate script that does all kind of nasty things as root :( If it was me, I'd install a rails logrotate file *once* that covered all your deployed applications... something like the below. This way it's installed once, and never needs to be installed again for any new applications. As long as you make sure the regex's match all your apps anyway :) /home/philip/apps/*/shared/log/*.log { daily missingok rotate 30 compress delaycompress notifempty create 640 philip philip sharedscripts postrotate if [ -f `. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}` ]; then /etc/init.d/apache2 reload /dev/null fi endscript } -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] SSL Requirement double POST from IE on expired certificate
This is really weird. User testing in my staging environment where the SSL certificate for the secure domain has expired. Here is the scenario: User fills in a form containing a serial number which has to be unique. which I use validate_uniqueness and a unique index on the mysql db (belt and braces). The create action is fired in the controller to do the insert on the model. So far so good. The next controller new action is protected by SSL and this domain has an expired certificate and IE8 puts up the expected warning which the user will ignore. The original POST and the create action is invoked again, to which the model says that it has a duplicate serial number. Why is the POST sent again by the browser? Doesn't happen on any other browser. I could install another valid test certificate but it is a real pain to do (too many sleazy sales guys call and they do not understand what they are selling!). Any other suggestion as to how to avoid this happening and how I can write some tests for this! Here is an excerpt from the log. Processing ConfirmationController#new (for some.ip.add.ress at 2011-03-28 19:23:39) [GET] snip Completed in 204ms (View: 143, DB: 11) | 200 OK [http:// test.nonssldomain.co.uk/confirmation/new/21] Processing ConfirmationController#create (for some.ip.add.ress at 2011-03-28 19:24:06) [POST] snip Confirmation Create (0.2ms) INSERT INTO `confirmations` (`flags`, `quote_id`, `created_at`, `updated_at`, `id`, `serialnum`) VALUES(4, 21, '2011-03-28 18:24:06', '2011-03-28 18:24:06', 21, '434343434') SQL (3.2ms) COMMIT Redirected to http://test.nonssldomain.co.uk/payment/new/21?payment=monthly Completed in 71ms (DB: 12) | 302 Found [http://test.nonssldomain.co.uk/ confirmation] Processing PaymentController#new (for some.ip.add.ress at 2011-03-28 19:24:07) [GET] snip Redirected to https://secure.ssldomain.com/payment/new/21?payment=monthly Filter chain halted as [:ensure_proper_protocol] rendered_or_redirected. Completed in 35ms (DB: 5) | 302 Found [http://test.nonssldomain.co.uk/ payment/new/21?payment=monthly] Processing ConfirmationController#create (for some.ip.add.ress at 2011-03-28 19:24:22) [POST] Parameters: {confirmation={serialnum=434343434, resident=1}, authenticity_token=lrUm1Ja +jjx5TxO1H4p9BhvgsjHpQwV/r5tyZvijJpw=} snip Confirmation Load (0.3ms) SELECT * FROM `confirmations` WHERE (`confirmations`.`serialnum` = '434343434') LIMIT 1 SQL (0.1ms) ROLLBACK snip Completed in 119ms (View: 63, DB: 11) | 200 OK [http:// test.nonssldomain.co.uk/confirmation] -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Rails 2 Question
Thanks Alex. So are you saying that previous to Rails 3, there was no command that would install all the gems needed? I have install them one by one? Bertly On Mar 28, 2:29 pm, Alexandre Friquet alexandre.friq...@infopiiaf.fr wrote: Hi, What was the predecessor to bundler? The gems were declared in environment.rb like the ones you saw. Is there a way to quickly set up my environment. And where is the gemfile...all I see if a few gems listed in the environment.rb file? I recommend you use bundler for Rails 2.3.x apps :http://gembundler.com/rails23.html Hope it helps. Alex -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Rails 2 Question
I believe the command you are looking for is rake gems:install jason On Mon, Mar 28, 2011 at 2:01 PM, bertly_the_coder much...@gmail.com wrote: Thanks Alex. So are you saying that previous to Rails 3, there was no command that would install all the gems needed? I have install them one by one? Bertly On Mar 28, 2:29 pm, Alexandre Friquet alexandre.friq...@infopiiaf.fr wrote: Hi, What was the predecessor to bundler? The gems were declared in environment.rb like the ones you saw. Is there a way to quickly set up my environment. And where is the gemfile...all I see if a few gems listed in the environment.rb file? I recommend you use bundler for Rails 2.3.x apps : http://gembundler.com/rails23.html Hope it helps. Alex -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Strange issue with Rails middleware, Warden and missing path paremeters
Hey, this started as OmniAuth issue and is pretty well document here: https://github.com/intridea/omniauth/issues/#issue/239/comment/917065 If you have a bare Rails app with Devise gem (Warden itself would probably be enough), add the following middleware to simulate OmniAuth behavior: class BreakApp def initialize(app) @app = app end def call(env) @app.call(env.dup) # call 1 @app.call(env) # call 2 end end and call Warden in ApplicationController before_filter e.g.: request.env['warden'].authenticate(:scope = :user) then params[:controller] and params[:action] are missing. If you remove the before filter *or* change the first call in the middleware to @app.call(env) (without #dup) it works fine. I prepared a sample app to show this issue: https://github.com/szimek/omniauth_dynamic_providers_bug I have no idea if this issue is caused by Rails or Warden code. Any ideas why path parameters are missing and how to fix it are welcome :) Cheers, Szymon -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: how to use ruby mine
Better to use latest RubyMine 3.1.1 RC2 build. 3.1.1 version is a bug fix update for 3.1. On Mar 28, 7:55 pm, Paul p...@nines.org wrote: And the newest version is 3.1, so the first thing I'd do is get the latest version and try with that. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] why does my method return an error if argument is not a number?
Hey all, I get the following error message: ActionView::TemplateError (class or module required for rescue clause) in app/vie$ app/helpers/format_helper.rb:116:in `divide_numbers' Basically I have a field in database called Student Fails and I populate fields with data. Sometimes the value can be empty - not null, not integer, just empty because when user updates record they clear out field and update it. First in my progressbar file I render a partial called progressbar_item, passing in the string to the partial in render method as well as data parameters that I can use in my progressbar file: = render dashboard/progressbar_item.html, :actual = @student_counters[:student_failed], :expected = cu.context.expected_student_failed, :title = Student Fails Now with the data parameters available in my view, I call the divide_numbers method with the values of those parameters so if expected_student_failed was an empty value in database, that empty value gets passed as the second argument: = render dashboard/progressbar.html, :value = divide_numbers(actual.to_f, expected), :text = #{actual} / #{expected} Then the method is executed in format_helper: def divide_numbers(x, y) result = x / y result.to_s == 'NaN' ? 0 : result rescue 0 end If y is nothing (empty), the error occurs. If y is an integer the error doesn't occur. Doesn't this line take all non numbers like empty and convert it to integer 0: result.to_s == 'NaN' ? 0 : result If that's the case, then why do I get the error? Will I be forced to do this (i haven't tested this yet but I presume it would work): def divide_numbers(x, y) result = x / y if result.nil? result.to_s = 0 else result.to_s == 'NaN' ? 0 : result end rescue 0 end Thanks for response. -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Set bounce address with ActionMailer::ARMailer
On Mar 28, 4:47 pm, Max Williams li...@ruby-forum.com wrote: Frederick Cheung wrote in post #989604: On Mar 28, 1:52pm, Max Williams li...@ruby-forum.com wrote: I tried again, setting the 'Return-Path' header when building the email, but the Return-Path header in the received mail is still set to be the same as the from address. Yahoo may be forcing the return path (eg so that you can't spam people by sending email you know will bounce and setting the return-path to be the victim's email address, thus getting someone else's mail server to send the spam message) ah...in that case (assuming other mail servers will do the same thing) then i'm screwed, right? As far as having a bounce address which is different to the from address goes anyway. I don't think it will be true of all mail servers, although it may well be true of most services like yahoo, gmail etc. Fred -- Posted viahttp://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] why does my method return an error if argument is not a number?
On Mon, Mar 28, 2011 at 4:02 PM, John Merlino li...@ruby-forum.com wrote: Hey all, I get the following error message: ActionView::TemplateError (class or module required for rescue clause) in app/vie$ app/helpers/format_helper.rb:116:in `divide_numbers' Basically I have a field in database called Student Fails and I populate fields with data. Sometimes the value can be empty - not null, not integer, just empty because when user updates record they clear out field and update it. First in my progressbar file I render a partial called progressbar_item, passing in the string to the partial in render method as well as data parameters that I can use in my progressbar file: = render dashboard/progressbar_item.html, :actual = @student_counters[:student_failed], :expected = cu.context.expected_student_failed, :title = Student Fails Now with the data parameters available in my view, I call the divide_numbers method with the values of those parameters so if expected_student_failed was an empty value in database, that empty value gets passed as the second argument: = render dashboard/progressbar.html, :value = divide_numbers(actual.to_f, expected), :text = #{actual} / #{expected} Then the method is executed in format_helper: def divide_numbers(x, y) result = x / y This line will raise an error if y is nil or blank... It won't even get to the next line. result.to_s == 'NaN' ? 0 : result rescue 0 end If y is nothing (empty), the error occurs. If y is an integer the error doesn't occur. Doesn't this line take all non numbers like empty and convert it to integer 0: result.to_s == 'NaN' ? 0 : result If that's the case, then why do I get the error? Will I be forced to do this (i haven't tested this yet but I presume it would work): def divide_numbers(x, y) result = x / y if result.nil? result.to_s = 0 else result.to_s == 'NaN' ? 0 : result end rescue 0 end Thanks for response. -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: why does my method return an error if argument is not a number?
On Mar 28, 10:02 pm, John Merlino li...@ruby-forum.com wrote: Hey all, I get the following error message: ActionView::TemplateError (class or module required for rescue clause) in app/vie$ app/helpers/format_helper.rb:116:in `divide_numbers' Basically I have a field in database called Student Fails and I populate fields with data. Sometimes the value can be empty - not null, not integer, just empty because when user updates record they clear out field and update it. First in my progressbar file I render a partial called progressbar_item, passing in the string to the partial in render method as well as data parameters that I can use in my progressbar file: = render dashboard/progressbar_item.html, :actual = @student_counters[:student_failed], :expected = cu.context.expected_student_failed, :title = Student Fails Now with the data parameters available in my view, I call the divide_numbers method with the values of those parameters so if expected_student_failed was an empty value in database, that empty value gets passed as the second argument: = render dashboard/progressbar.html, :value = divide_numbers(actual.to_f, expected), :text = #{actual} / #{expected} Then the method is executed in format_helper: def divide_numbers(x, y) result = x / y result.to_s == 'NaN' ? 0 : result rescue 0 end That's not legal ruby - where you've stuck a 0 it's expecting a class name (which sort of exceptions the rescue clause should handle). You may be mixing things up with the one liner do_foo rescue 0. Also floats have a nan? method which would be a little nicer than that string comparison you have there If y is nothing (empty), the error occurs. If y is an integer the error doesn't occur. Doesn't this line take all non numbers like empty and convert it to integer 0: result.to_s == 'NaN' ? 0 : result Not quite. That will only coerce NaN to 0, but it wouldn't do anything to Infinity, and of course you wouldn't even get to this line if y was something such that x / y was meaningless (ie y is not coercible to a numeric value). NaN isn't a placeholder for anything that isn't a number but for specific situations where it isn't possible to come up with a more meaningful answer (eg 0.0/0 ) Fred If that's the case, then why do I get the error? Will I be forced to do this (i haven't tested this yet but I presume it would work): def divide_numbers(x, y) result = x / y if result.nil? result.to_s = 0 else result.to_s == 'NaN' ? 0 : result end rescue 0 end Thanks for response. -- Posted viahttp://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Rails 2 Question
Thank you sir! On Mar 28, 3:43 pm, jason white jasonwhite...@gmail.com wrote: I believe the command you are looking for is rake gems:install jason On Mon, Mar 28, 2011 at 2:01 PM, bertly_the_coder much...@gmail.com wrote: Thanks Alex. So are you saying that previous to Rails 3, there was no command that would install all the gems needed? I have install them one by one? Bertly On Mar 28, 2:29 pm, Alexandre Friquet alexandre.friq...@infopiiaf.fr wrote: Hi, What was the predecessor to bundler? The gems were declared in environment.rb like the ones you saw. Is there a way to quickly set up my environment. And where is the gemfile...all I see if a few gems listed in the environment.rb file? I recommend you use bundler for Rails 2.3.x apps : http://gembundler.com/rails23.html Hope it helps. Alex -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Rails 2 Question
also: rake gems:install RAILS_ENV=development Trevor On Mon, Mar 28, 2011 at 3:43 PM, jason white jasonwhite...@gmail.com wrote: I believe the command you are looking for is rake gems:install jason On Mon, Mar 28, 2011 at 2:01 PM, bertly_the_coder much...@gmail.com wrote: Thanks Alex. So are you saying that previous to Rails 3, there was no command that would install all the gems needed? I have install them one by one? Bertly On Mar 28, 2:29 pm, Alexandre Friquet alexandre.friq...@infopiiaf.fr wrote: Hi, What was the predecessor to bundler? The gems were declared in environment.rb like the ones you saw. Is there a way to quickly set up my environment. And where is the gemfile...all I see if a few gems listed in the environment.rb file? I recommend you use bundler for Rails 2.3.x apps :http://gembundler.com/rails23.html Hope it helps. Alex -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Routes and REST Issue
Hi all, A relative newcomer to routes here - I have a controller on which I would like to be able to specify only a couple RESTful operations (my example is for a RESTful user sessions controller, where it only makes sense to (1) create a session, and (2) destroy a session). Using 'resources' on a controller in the routes file gives all seven methods so I'm not using that; I only need the two above, so my routes file looks like this: match 'sessions' = 'sessions#create', :via = :put match 'sessions' = 'sessions#destroy', :via = :delete Essentially I want a user to send a put (this is an idempotent operation) to the sessions collection URL, with a params hash of username and password. And calling delete on the same URL will log out the session. However, my RSpec test, which looks like this: describe PUT 'new' do # (NB this user is created in the 'before' method) it should be successful do put 'new', {:name = 'a_user_logging_in', :password = 'a_password'} response.should be_success end it should not be successful with a wrong username or password do put 'new', {:name = 'an_incorrect_user', :password = 'a_password'} response.should_not be_success end end Does not pass as the routing fails! Here is the RSpec error: Failure/Error: put 'new', {:name = 'a_user_logging_in', :password = 'a_password'} ActionController::RoutingError: No route matches {:name=a_user_logging_in, :password=a_password, :controller=sessions, :action=new} So clearly I've made an error here somewhere with my Routes, can someone help me achieve what I'm after (i.e. just a put and delete on a collection, which calls create and destroy on the controller?). Many many thanks for your kind help, - Nex -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Routes and REST Issue
Phil On Mon, Mar 28, 2011 at 4:52 PM, Peter Laurens li...@ruby-forum.com wrote: Hi all, A relative newcomer to routes here - I have a controller on which I would like to be able to specify only a couple RESTful operations (my example is for a RESTful user sessions controller, where it only makes sense to (1) create a session, and (2) destroy a session). Using 'resources' on a controller in the routes file gives all seven methods so I'm not using that; I only need the two above, so my routes file looks like this: match 'sessions' = 'sessions#create', :via = :put match 'sessions' = 'sessions#destroy', :via = :delete Making a create route does not give you a route for 'new' -- you'll need to create both. You can also do: resources :sessions, :only = [:new, :create, :destroy] if you like. Essentially I want a user to send a put (this is an idempotent operation) to the sessions collection URL, with a params hash of username and password. And calling delete on the same URL will log out the session. However, my RSpec test, which looks like this: describe PUT 'new' do # (NB this user is created in the 'before' method) it should be successful do put 'new', {:name = 'a_user_logging_in', :password = 'a_password'} response.should be_success end it should not be successful with a wrong username or password do put 'new', {:name = 'an_incorrect_user', :password = 'a_password'} response.should_not be_success end end Does not pass as the routing fails! Here is the RSpec error: Failure/Error: put 'new', {:name = 'a_user_logging_in', :password = 'a_password'} ActionController::RoutingError: No route matches {:name=a_user_logging_in, :password=a_password, :controller=sessions, :action=new} So clearly I've made an error here somewhere with my Routes, can someone help me achieve what I'm after (i.e. just a put and delete on a collection, which calls create and destroy on the controller?). Many many thanks for your kind help, - Nex -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] undefined method load_paths for ActiveSupport::Dependencies:Module Error
I'm writing a Rails plugin from scratch and recently generating models inside it. In fact, i'm trying to follow the guide from http://guides.rubyonrails.org/plugins.html so i used the following code taken from this site in order to make the models appear like files in the main app directory (as it was said) this is the code: %w{ models }.each do |dir| path = File.join(File.dirname(__FILE__), 'app', dir) $LOAD_PATH path ActiveSupport::Dependencies.load_paths path ActiveSupport::Dependencies.load_once_paths.delete(path) end __ When i run 'rails console ' this error appear undefined method `load_paths' for ActiveSupport::Dependencies:Module (NoMethodError) thanks for your help -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Debugging help needed
I have an odd problem I'm stumped on how to debug. I'm running Rails 2.3.5 under rvm. I'm doing a new test that *should* work but it does not. My test is I clear my database so it is empty and then start a request. Its a complex application that interacts with another legacy server fetching things, putting them into the database, and then presents a final rendering. I make the request and I see my ruby process (using top) consume cpu of varying degrees (16% up to 50%). Then it goes to 100% and sits there. At that point, my log file stops growing. The last few entries are: Cached fragment miss: views/PEDZ,S,165,405-1301358353.887364-qs (0.3ms) Rendered retain/qs/_qs_row (990.1ms) Rendered layouts/shared/_doctype (0.3ms) Rendered layouts/shared/_header (1.6ms) Rendered layouts/shared/_body (0.8ms) But I do not have the Completed entry that usually ends each request. So it is stuck somewhere after most of the rendering, perhaps in the sending stage. And that is what I need help with. How do I find where it is getting stuck at? Thank you, pedz -- Posted via http://www.ruby-forum.com/. -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] recaptcha displaying weirdly
Hi List, I've followed and read several guides for getting recaptcha working with a site but I keep coming across this problem. The recaptcha images look...weird: This image is taken with the white theme, however the sandard one is exactly as weird. I can't work out what is causing this: http://www.mattharrison.org/images/recaptcha-weird-look.JPG Any tips appreciated. pgpZ3JTDZ2WyM.pgp Description: PGP signature
[Rails] stack level too deep
SystemStackError in Issues#show Showing app/views/issues/show.rhtml where line #28 raised: stack level too deep Extracted source (around line #28): 25: th class=due-date%=l(:field_due_date)%:/thtd class=due-date%= format_date(@issue.due_date) %/td 26: /tr 27: tr 28: th class=assigned-to%=l(:field_assigned_to)%:/thtd class=assigned-to%= avatar(@issue.assigned_to, :size = 14) %%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : - %/td 29: th class=progress%=l(:field_done_ratio)%:/thtd class=progress%= progress_bar @issue.done_ratio, :width = '80px', :legend = #{@issue.done_ratio}% %/td 30: /tr 31: tr RAILS_ROOT: /home/hkakada/rails_apps/redmine Application Trace | Framework Trace | Full Trace /home/hkakada/rails_apps/redmine/vendor/plugins/redmine_local_avatars-0.1.1/lib/application_helper_avatar_patch.rb:30:in `avatar_without_local' /home/hkakada/rails_apps/redmine/vendor/plugins/redmine_local_avatars-0.1.1/lib/application_helper_avatar_patch.rb:38:in `avatar' /home/hkakada/rails_apps/redmine/app/views/issues/show.rhtml:28:in `_run_rhtml_app47views47issues47show46rhtml' /home/hkakada/rails_apps/redmine/app/controllers/issues_controller.rb:117:in `show' /home/hkakada/rails_apps/redmine/app/controllers/issues_controller.rb:116:in `show' /home/hkakada/rails_apps/redmine/vendor/plugins/redmine_local_avatars-0.1.1/lib/application_helper_avatar_patch.rb:30:in `avatar_without_local' /home/hkakada/rails_apps/redmine/vendor/plugins/redmine_local_avatars-0.1.1/lib/application_helper_avatar_patch.rb:38:in `avatar' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in `send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/renderable.rb:34:in `render' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:306:in `with_template' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/renderable.rb:30:in `render' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/template.rb:205:in `render_template' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:265:in `render' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:348:in `_render_with_layout' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/base.rb:262:in `render' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1250:in `render_for_file' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:945:in `render_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:51:in `render' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms' /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:51:in `render' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/mime_responds.rb:135:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/mime_responds.rb:135:in `custom' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/mime_responds.rb:179:in `call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/mime_responds.rb:179:in `respond' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/mime_responds.rb:173:in `each' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/mime_responds.rb:173:in `respond' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/mime_responds.rb:107:in `respond_to' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms' /usr/lib/ruby/1.8/benchmark.rb:308:in `realtime' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in `perform_action_without_flash' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'
Re: [Rails] why does my method return an error if argument is not a number?
On 28 March 2011 22:02, John Merlino li...@ruby-forum.com wrote: If y is nothing (empty), the error occurs. If y is an integer the error doesn't occur. yup. divide by zero will do that... Doesn't this line take all non numbers like empty and convert it to integer 0: result.to_s == 'NaN' ? 0 : result If that's the case, then why do I get the error? Unfortunately, your code is breaking before there, and I doubt it would work as you expect even if it did (I don't think you can be sure the integer would be 'NaN') Try this instead: def divide_numbers(x, y) (x / y) rescue 0 end -- 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, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.