[Rails] Migration of existant data
Hi, I'm actually coding an application which use data from an other one. (Zone Region Country Location exactly) which are not in the best form. There are primary keys defined on the names of the zone / region / ... and link between tables with foreign keys using the primary keys of the parrent table (logical) I must use this data but I must use the Rails format in the database (foreign keys on id) I can't modify the other database / application. Do you have an idea how to realize that ? PS: sorry for my poor english :s -- 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: Need help 'observe_field' to work in Safari or Konqueror
Konquerer isn't officially supported by Prototype.js which Rails uses for it's Ajax stuff. The latest version of Prototype is compatible with the following browsers: Browser Version(s) Mozilla Firefox ≥ 1.5 Microsoft Internet Explorer ≥ 6.0 Apple Safari≥ 2.0 Opera ≥ 9.25 There should be no issue with Safari 3 or 2. On Jun 8, 1:30 am, Jim Burgess rails-mailing-l...@andreas-s.net wrote: That'll teach me to re-read things before I post. The URL is:http://igsn-application.de/test/ Sorry! -- 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: why can't I add a :class to text_field?
What is 'f' ? form_tag or field_tag for which object? On Jun 8, 10:57 am, Zhenning Guan rails-mailing-l...@andreas-s.net wrote: %= text_field_tag 'login' ,nil, {:class = 'line'} % the old way work. %= f.text_field :login, :class = 'line' % but why this doesn't. -- 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: Remove special characters from sentence
(teststring.gsub(/[^a-zA-Z 0-9]/, )).gsub(/\s/,'-') Sijo -- 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] Passenger on Ruby EE
I Installed Passenger with Ruby EE. Now I have 2 ruby locations. 1) /opt/rubyee/bin 2) /usr/lib/ruby do I still want to keep both these locations. Can I get rid of the old ruby libs (i.e /usr/lib/ruby ). thanks in advance. webnuwan --~--~-~--~~~---~--~~ 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: ActiveRecord Classes
On Jun 8, 5:11 am, J. D. rails-mailing-l...@andreas-s.net wrote: Hi Fred, I think I will use this for my find parameter: start_date = Time.now.beginning_of_week end_date = Time.now.end_of_week @rushing_offenses = RushingOffense.find(:all, :conditions = ['created_at ? and created_at ?', start_date, end_date]) That will let me find anything created within the set week. Now I just have to figure out how to check whether or not it returns nil and create data.. It will never return nil. It will return an array (possibly an empty one). You might want to set your own timestamp and use that rather than relying on created at (so that the date is one that is significant to your data and not just when you happened to run your scraper) 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] hi folks....
i m a beginner in ruby on rails... i need a complete a code for the following... 1. To parse a word document containing the students details... 2.i ve to link these details in to database... i need all the codings to be done in ruby on rails... --~--~-~--~~~---~--~~ 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: Inner Join help
On Jun 8, 5:18 am, Scott Holland rails-mailing-l...@andreas-s.net wrote: Hello! I want to limit my model to just show companies from the current users account: user.account.companies I have this in my model which seems to be working: def self.find(*args) args {:conditions = X} super end I would question the wisdom of doing that - it may work in the short term, but you may find it breaks other stuff. Now I just need to turn this sql into rails conditions: SELECT `companies`.* FROM `companies` INNER JOIN `users` ON `companies`.user_id = `users`.id WHERE ((`users`.account_id = 1)) Take a look at the :joins option to find (if you have the associations right you don't even need to write out the join clause in full, specifying the name of the association is enough). In this case though I'm not sure why you wouldn't just do some_user.account.companies; you'd get back the same result set. Fred Can anyone help with this? Thanks Scott -- 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: Migration of existant data
It is not clear to me whether you need to access the data in the existing database from within a rails app, keeping the existing db format, or whether you are trying to do a one time extraction of the data from the existing database into a new one which is in conventional rails format. ( You said you cannot change the existing db, but you also said you must use the rails format in the db). Colin 2009/6/8 Arnaud Geo rails-mailing-l...@andreas-s.net: Hi, I'm actually coding an application which use data from an other one. (Zone Region Country Location exactly) which are not in the best form. There are primary keys defined on the names of the zone / region / ... and link between tables with foreign keys using the primary keys of the parrent table (logical) I must use this data but I must use the Rails format in the database (foreign keys on id) I can't modify the other database / application. Do you have an idea how to realize that ? PS: sorry for my poor english :s -- 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] Export to pdf (graph output)
So i have tasks, with start time, end time, the usual stuff, and i need to export all the info to pdf (description, owner, relations, etc) Export text to pdf shouldn't be a problem, there are many tutorials who explain it I also need to export a gant chart (need some way to make a screenshot from the gantt i have, or make it from the data). making it from data would be perfect, some eye candy, would also be good. Graphviz was what come to mind to do it, is it the best? should i use an alternative(something to make charts). So what gems should i use, do you know a tutorials who implements similar stuff? Cumps Celso Costa --~--~-~--~~~---~--~~ 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] Problem with set-cookie?
Hello everyone, I'm a beginner in Ruby on Rails and I have a little problem when I update my application RoR in my server. Can you help me please? My problem is: When I code my application in my computer: It's ok. When I update my application in my server I have a bug with cookies. When a user come in my website for the first time, I initialize some cookies. But in my server I have a message in my page and the cookies isn't initialize: Set-Cookie: boite=1-2; path=/ Set-Cookie: _mileva2_session_id=BAh7CDoPc2Vzc2lvbl9pZCIlMzAyYjdlMjNiMzg5MDZlM2I3OTZlYTY4MzZkYjdkMjciCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA6EF9jc3JmX3Rva2VuIjFHTDY3TmcvclhXeXIwTG5YcDlmbzBkOFU1eW1VQkNYNUVhU2d2Qm1DdUIwPQ%3D%3D--2ea57948c303a0b69628eb3b8798eba64ef4dd44; path=/; HttpOnly It's working perfectly in my computer and I searched the problem in different place but no result :( My version of rails is 2.3.2. A fragment of my code where I initialize the cookies: In welcome_controller.rb # 3 # Dans le cas où j'ai ni cookie, et que je suis pas loggué boite = Box.find( :all, :conditions = capsules.admin = '1' boxes.user_id = '0', :order = 'position', :group = 'capsule_id', :joins = inner join capsules on boxes.capsule_id = capsules.id ) @box = boite # Pour créer les starters et les closers @number = 8 - boite.length # Initialisation des cookies cookies[:user] = 'mileva' cookie_text = j = 0 for box in boite if(j = 1) cookie_text = cookie_text + - end cookie_text = cookie_text + box.capsule.id.to_s j = j + 1 end cookies[:boite] = cookie_text You can see the error in www.mileva.eu (Warning, if you don't visit for the first time, you have to clear your cookies) Thank you and Have fun Joachim -- 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: hi folks....
I may not fully understand the question, but are you asking someone to supply the whole application for you? If not then a more focussed question indicating the particular detail that you need help with would be better. I presume you have already worked through some tutorials such as the rails guides and used google to try and answer the questions yourself. Colin 2009/6/8 anandh anandhthiyagara...@gmail.com: i m a beginner in ruby on rails... i need a complete a code for the following... 1. To parse a word document containing the students details... 2.i ve to link these details in to database... i need all the codings to be done in ruby on rails... --~--~-~--~~~---~--~~ 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 get value from view?
Hello all, I have following problem, I have a view called new_sub_type.html.haml and controller SubscriptionTypes. In this view i'm showing a dropdown list of subscription types. When user submit form, I show another view new_credit_card.html.haml which is in controller CreditCards. This form is submitted to SubscriptionTypes controller. Then i validate credit card information in SubscriptionTypes controller. if credit card info is not valid then i redirect to again credit cards new.html. When user select value subscription type from first form, I want to use that subscription type value in SubscriptionTypes controller. I don't know how to get that value? i used session.then I get value of subscription type, but if credit card info is not valid I get nil value when redirected to new_credit_card.html.haml? Is there another way? Thanks, Vikas. -- 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: Remove special characters from sentence
Thanks Sijo ! On Mon, Jun 8, 2009 at 1:20 PM, Sijo Kg rails-mailing-l...@andreas-s.netwrote: (teststring.gsub(/[^a-zA-Z 0-9]/, )).gsub(/\s/,'-') Sijo -- Posted via http://www.ruby-forum.com/. -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.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] will_paginate links have broken urls
hey folks I have a page that used to have a url in this sort of form /resources/browse/property_ids[]=72property_ids[]=722 I changed the format to be nicer - using the name of the properties and seperating with a + /resources/browse/72-Violin+722-Pieces The '+' acts as a join between two property ids effectively, so in the controller the last part is split on +, and the above is equivalent to the first url. This all works fine, and gives a nicer url. However, will_paginate is now doing something strange - the paginate links for the page now come out like this: /resources/browse/72-Violin/722-Pieces?page=3 where i'd expect them to be this, ie to just add the param to the end of whatever the current page is: /resources/browse/72-Violin+722-Pieces?page=3 Before/while i dive into the guts of will_paginate to see what might be going wrong, can anyone shed any light? thanks max -- 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] Will Pagination links getting not behaving as i wanted.
Hello All, I have will pagination links in index view which works fine. but when i performing some other action and replacing list view that time pagination links i am supposed to be for index action. but they are not..links goes to last performed action. You have any idea how to fix this problem ? NOTE: i am updating list after creation of resource record that time pagination links goes to create action. I have -- resource comment which is polymorphic in nature. resource post, forum, etc. they have many association with comments, comments_controller where creation and list population is written. Sandip R~ -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.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: Migration of existant data
In a short time after the application goes on, there will be an automatic update of the location tables from the other database. Because the structure of each database (original one and mine) are not the same, it will be harder. Is there a trick to handle this problem in Rails (to keep the classic structure for primary and foreign keys in Rails) or is it better to keep the original struture i would like to import for primary and foreign keys ? (and use a plugin to define primary / foreign keys in Rails) -- 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: hi folks....
thanks for your quick reply... see i have to parse a word document and i have to map those details to database in ROR... On Jun 8, 5:45 pm, Colin Law clan...@googlemail.com wrote: I may not fully understand the question, but are you asking someone to supply the whole application for you? If not then a more focussed question indicating the particular detail that you need help with would be better. I presume you have already worked through some tutorials such as the rails guides and used google to try and answer the questions yourself. Colin 2009/6/8 anandh anandhthiyagara...@gmail.com: i m a beginner in ruby on rails... i need a complete a code for the following... 1. To parse a word document containing the students details... 2.i ve to link these details in to database... i need all the codings to be done in ruby on rails... --~--~-~--~~~---~--~~ 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 add these headers to a xml response
Hi, I need to create something like this: ?xml version=1.0 encoding=UTF-8? Container idaQlfVHX+qPM/id lifetime2009-09-19T08:14:55Z/lifetime /Container The response should contain the next headers: Content-Type=`application/vnd.3gpp+xml` Authentication-Info={rspauth=`xxx...xxx`,qop=`auth-int`,cnonce=`xxx`,nc=`000 1`} How can I do that? I always see {Cache-Control=no-cache, Content-Type=application/xml} when I print the headers... I can use xml builder ok to generate the xml, but I have the problem with the headers. 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] Re: hi folks....
That's not really what we do here...try http://www.rentacoder.com On Jun 8, 6:39 am, anandh anandhthiyagara...@gmail.com wrote: thanks for your quick reply... see i have to parse a word document and i have to map those details to database in ROR... On Jun 8, 5:45 pm, Colin Law clan...@googlemail.com wrote: I may not fully understand the question, but are you asking someone to supply the whole application for you? If not then a more focussed question indicating the particular detail that you need help with would be better. I presume you have already worked through some tutorials such as the rails guides and used google to try and answer the questions yourself. Colin 2009/6/8 anandh anandhthiyagara...@gmail.com: i m a beginner in ruby on rails... i need a complete a code for the following... 1. To parse a word document containing the students details... 2.i ve to link these details in to database... i need all the codings to be done in ruby on rails... --~--~-~--~~~---~--~~ 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: hi folks....
thanks for your reply... atleast just say me the overview or steps i have to follow in doing that application... On Jun 8, 7:44 pm, p_W paulwoolcoc...@gmail.com wrote: That's not really what we do here...try http://www.rentacoder.com On Jun 8, 6:39 am, anandh anandhthiyagara...@gmail.com wrote: thanks for your quick reply... see i have to parse a word document and i have to map those details to database in ROR... On Jun 8, 5:45 pm, Colin Law clan...@googlemail.com wrote: I may not fully understand the question, but are you asking someone to supply the whole application for you? If not then a more focussed question indicating the particular detail that you need help with would be better. I presume you have already worked through some tutorials such as the rails guides and used google to try and answer the questions yourself. Colin 2009/6/8 anandh anandhthiyagara...@gmail.com: i m a beginner in ruby on rails... i need a complete a code for the following... 1. To parse a word document containing the students details... 2.i ve to link these details in to database... i need all the codings to be done in ruby on rails... --~--~-~--~~~---~--~~ 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 add these headers to a xml response
On Jun 8, 11:43 am, comopasta Gr rails-mailing-l...@andreas-s.net wrote: Hi, I need to create something like this: ?xml version=1.0 encoding=UTF-8? Container idaQlfVHX+qPM/id lifetime2009-09-19T08:14:55Z/lifetime /Container The response should contain the next headers: Content-Type=`application/vnd.3gpp+xml` Authentication-Info={rspauth=`xxx...xxx`,qop=`auth-int`,cno nce=`xxx`,nc=`000 1`} You should just be able to set headers['foo'] in your controller. Fred How can I do that? I always see {Cache-Control=no-cache, Content-Type=application/xml} when I print the headers... I can use xml builder ok to generate the xml, but I have the problem with the headers. Thanks. -- 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: hi folks....
Well Word doc's are tricky, here's some ideas from SO.com: http://stackoverflow.com/questions/375861/how-to-parse-word-documents-with-ruby That will probably be the hardest part, after parsing it, it should be a pretty standard thing to take the data and put it in a DB, any decent Rails tutorial can teach you that. On Jun 8, 7:01 am, anandh anandhthiyagara...@gmail.com wrote: thanks for your reply... atleast just say me the overview or steps i have to follow in doing that application... On Jun 8, 7:44 pm, p_W paulwoolcoc...@gmail.com wrote: That's not really what we do here...try http://www.rentacoder.com On Jun 8, 6:39 am, anandh anandhthiyagara...@gmail.com wrote: thanks for your quick reply... see i have to parse a word document and i have to map those details to database in ROR... On Jun 8, 5:45 pm, Colin Law clan...@googlemail.com wrote: I may not fully understand the question, but are you asking someone to supply the whole application for you? If not then a more focussed question indicating the particular detail that you need help with would be better. I presume you have already worked through some tutorials such as the rails guides and used google to try and answer the questions yourself. Colin 2009/6/8 anandh anandhthiyagara...@gmail.com: i m a beginner in ruby on rails... i need a complete a code for the following... 1. To parse a word document containing the students details... 2.i ve to link these details in to database... i need all the codings to be done in ruby on rails... --~--~-~--~~~---~--~~ 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] Pagination: Last Page
Hi Folks is there any way to link to the last page of a paginated list, if the number of pages is not available in this moment? For example a forum with topic and replies. I'd like to link to the last page of the replies, but I don't know how many pages there are in the forum view? I'm using mislav-will_paginate for pagination. Thank you in advance! -- 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: Need help 'observe_field' to work in Safari or Konqueror
Hi, Thanks for replying Konquerer isn't officially supported by Prototype.js which Rails uses for it's Ajax stuff. That's not so bad. Konqueror I can live without (although it's not perfect) There should be no issue with Safari 3 or 2. I am running Safari 4 public beta on Windows and the script (http://igsn-application.de) doesn't work in this browser. It also doesn't work on Chrome 2.0.172.30. It does however, work fine in FFox, IE and Opera. What the browsers in which it doesn't work have in common is that they are built on KHTML or Webkit (a fork of KHTML). Might this have something to do with it? I tried debugging the webpage with Safari's java script debugger. I get no errors, one warning and the following output: Warning. Resource interpreted as script but transferred with MIME type text/html.(index.js) XHR finished loading: http://igsn-application.de/test/get_members_1; prototype.js (line 1437). It seems to me that the script is fetching the html to display in the drop down box, but not displaying it for some reason. Or maybe rendering it off of the page?? I have also updated prototype to the latest version (1.6.1_rc2) Can anyone give me a hint as to what I am doing wrong or where I could start looking to solve this problem (all Google searches so far came up blank). Thanks for your time. -- 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: ActiveRecord Classes
Frederick Cheung wrote: On Jun 8, 5:11�am, J. D. rails-mailing-l...@andreas-s.net wrote: have to figure out how to check whether or not it returns nil and create data.. It will never return nil. It will return an array (possibly an empty one). You might want to set your own timestamp and use that rather than relying on created at (so that the date is one that is significant to your data and not just when you happened to run your scraper) Fred Hi Fred, Yep you were correct. If the query is empty it returns an empty array [] so I'll make some checks against that. I'll also take your advice and create a new column called compiled_on and associate it to timestamp. 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] SSL before or after submit?
A general question regarding SSL and login. Does it matter if a login form is not passed through SSL when sent to the user browser but the post action is? Will the password be sent through SSL in this case? -- 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] ActionMailer HTML emails appear as HTML code in email client
Hi I'm trying to send multipart emails with something like this: Taken from http://api.rubyonrails.org/classes/ActionMailer/Base.html [code=] class ApplicationMailer ActionMailer::Base def signup_notification(recipient) recipients recipient.email_address_with_name subject New account information fromsys...@example.com content_typemultipart/alternative part :content_type = text/html, :body = render_message(signup-as-html, :account = recipient) part text/plain do |p| p.body = render_message(signup-as-plain, :account = recipient) p.transfer_encoding = base64 end end end[/code] I have 2 view files signup-as-html.text.html.erb and signup-as- plain.text.plain.erb I sent a test email and picked it up in Apple Mail but it displays the HTML code instead of rendering it. Any idea why? Mark --~--~-~--~~~---~--~~ 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 links have broken urls
SOLVED This was nothing to do with will_paginate at all - it was down to me doing something bad in the controller. It's maybe a bit of a gotcha. There was a key in params called :property_ids, which could point to a string or an array. If it's a string, then i need to split it on the + sign and turn it into an array. The problem was i was doing this by altering the contents of params itself, like this: if params[:property_ids].is_a?(String) params[:property_ids] = params[:property_ids].split(+) end This was then being passed through to the page, in @template.params, which will_paginate uses, and the change from the string to an array was making will_paginate go wrong, generating an invalid url. So, the lesson here is 'don't alter params, copy the value out into a variable and then do the manipulation on that'. I ended up doing a tour into the guts of will_paginate, and then all the way back out again, just to discover this. doh. -- 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: ActionMailer HTML emails appear as HTML code in email client
This article got me working: http://www.caboo.se/articles/2006/02/19/how-to-send-multipart-alternative-e-mail-with-inline-attachments Still seems broken though --~--~-~--~~~---~--~~ 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 add these headers to a xml response
You should just be able to set headers['foo'] in your controller. Fred Thanks Fred! Yeah I've tried several ways. Now I've managed to get: {Cache-Control=no-cache, Authentication-info=rspauth=`xxx...xxx`,qop=`auth-int`,cnonce=`xxx`,nc=`0001`, Content-Type=application/xml} I still have problems with the content-type and getting rid of cache-control headers. For the content-type I've tried: response.content_type = and headers['Content-type'] = but still get always the default one. Haven't yet really tried to get rid of the cache-control. The response is generated like: respond_to do |format| format.xml end 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] Re: ActiveRecord Classes
Okay, The end result was modifying the model for the table I was working with to do the following: class RushingOffense ActiveRecord::Base def scrape offensive_rushing = Scraper.new('http://web1.ncaa.org/mfb/natlRank.jsp?year=2008rpt=IA_teamrushsite=org', 'table', 'statstable', '//tr') offensive_rushing.scrape_data offensive_rushing.clean_celldata start_date = Time.now.beginning_of_week end_date = Time.now.end_of_week current_date = Time.now @rushing_offenses = RushingOffense.find(:all, :conditions = ['compiled_on ? and compiled_on ?', start_date, end_date]) if @rushing_offenses == [] #means we have an empty array for i in 0..offensive_rushing.numrows-1 puts Updating Offensive Rushing Statistics for #{offensive_rushing.rows[i][1]}. RushingOffense.create(:rank = offensive_rushing.rows[i][0], :name = offensive_rushing.rows[i][1], :games = offensive_rushing.rows[i][2], :carries = offensive_rushing.rows[i][3], :net = offensive_rushing.rows[i][4], :avg = offensive_rushing.rows[i][5], :tds = offensive_rushing.rows[i][6], :ydspg = offensive_rushing.rows[i][7], :wins = offensive_rushing.rows[i][8], :losses = offensive_rushing.rows[i][9], :ties = offensive_rushing.rows[i][10], :compiled_on = current_date) end end if @rushing_offenses != [] #means the current week's data is not empty puts Current Week's Data Is Already Populated! end end end This code works 100% and doesn't overlap. However, if you could take a look at this code and let me know if there's something I should change to make it better or follow best practices to shorten or make it more efficient, I would be appreciative. I feel great now having completed my first difficult action with rails. -- 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] To deploy or not to deploy on App Engine
I am nearing the end on a project i have been working on and am trying to figure out where to host it. I am very tempted to host it on google's app engine. you get a ton of space, band width, and processor all for free! I was hoping to get some advice as to what people think about deplying on the app engine. Would it better to wait until ruby is supported? Are there perfomrance issues with using JRuby? What would happen if ruby were supported in the future, would transfering be a pain? --~--~-~--~~~---~--~~ 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: Send a array of objects from a view
Thanks Franco... On 6 jun, 02:31, Franco Catena francocat...@gmail.com wrote: The best way (for me) is using nested attributes (http:// api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ ClassMethods.html). You can look a very complete example of usage in:http://github.com/alloy/complex-form-examples/tree/masterand inhttp://github.com/soldieron/jquery-nested-forms/tree/master Regards. Franco Catena. On 5 jun, 13:49, Jose Ernesto Suarez suarez.erne...@gmail.com wrote: Hi everyone. I´m working on application that has a has_and_belongs_to_many betwen two models: expedientes and documentos. When I´m on the console, I need to pass a Expedientes Array to documentos, otherwise I get a ActiveRecord::AssociationTypeMismatch exception. Example: d=Documento.new = #Documento id: nil... d.expedientes=[1] ActiveRecord::AssociationTypeMismatch: Expediente(#18729340) expected, got Fixnum(#108610) ... d.expedientes=1 ActiveRecord::AssociationTypeMismatch: Expediente(#18729340) expected, got String(#113650) ... d.expedientes=Expediente.find(1) NoMethodError: undefined method `each' for #Expediente:0x23a96a0 ... d.expedientes=[Expediente.find(1)] = [#Expediente id: 1, ...That´s ok! How must I made this relationship from the view? I´ve mading a Form.hidden_field from the view new with the name expedientes and the value of the expediente.id of the relationship,but seems incorrect. What´s the best way to do 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] how can i get attribute values from xml using libxml
Hi , i have xml document like this ?xml version=1.0 encoding=ISO-8859-9? RootStk Category=601 Group=60101 Brand=001 then i have to use Category attribute but reader class couldnt recognize attributes when i use these codes below for testing; while reader.read puts reader.node_type end it shows only 1 and 15 values which means XML_READER_TYPE_ELEMENT = 1 XML_READER_TYPE_END_ELEMENT = 15 how can i get attribute values? i tried another method doc = reader.expand doc.find('//Root/Stk/[Category='601']') but it also didnt work --~--~-~--~~~---~--~~ 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: Getting an exception in actionpack: invalid byte sequence in US-ASCII with ruby 1.9
I ran into a similar problem a while back. Here's an email thread that might help: http://groups.google.com/group/rack-devel/browse_thread/thread/76065d11ea3d55c2/13c8e39c788186a8?hl=enlnk=gstq=rick#13c8e39c788186a8 Rick On May 28, 7:54 pm, Travis Reeder tree...@gmail.com wrote: After upgrading to Ruby 1.9 and Passenger, we started getting this while uploading a binary data file through a form. I'm not sure if it's ruby 1.9 or passenger, but either way, any help would be greatly appreciated. /!\ FAILSAFE /!\ 2009-05-28 00:39:30 + Status:500InternalServer Error invalid byte sequence in US-ASCII d /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/utils.rb:320:in `=~' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/utils.rb:320:in `block in parse_multipart' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/utils.rb:315:in `loop' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/utils.rb:315:in `parse_multipart' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/request.rb:125:in `POST' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/methodoverride.rb:15:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/params_parser.rb:15:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/rewindable_input.rb:25:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/session/cookie_store.rb:93:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/failsafe.rb:11:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/lock.rb:11:in `block in call' internal:prelude:8:in `synchronize' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/vendor/rack-1.0/rack/lock.rb:11:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/ action_controller/dispatcher.rb:106:in `call' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/rack/request_handler.rb:81:in `process_request' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_request_handler.rb:203:in `main_loop' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:340:in `start_request_handler' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:298:in `block in handle_spawn_application' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/utils.rb:181:in `safe_fork' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:296:in `handle_spawn_application' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server.rb:337:in `main_loop' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server.rb:187:in `start_synchronously' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server.rb:154:in `start' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/railz/application_spawner.rb:192:in `start' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/spawn_manager.rb:257:in `block (2 levels) in spawn_rails_application' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/spawn_manager.rb:251:in `block in spawn_rails_application' /usr/local/lib/ruby/gems/1.9.1/gems/passenger-2.2.2/lib/ phusion_passenger/abstract_server_collection.rb:80:in `block in synchronize' internal:prelude:8:in `synchronize' --~--~-~--~~~---~--~~ 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] Printing out Cucumber step definitions
Hi there, After a few years of almost complete silence, I'm back at blogging about Ruby and Rails-related stuff again. For a first post, I'm showing a rake task you can use if you want to print out Cucumber step definitions for your app, grouped by source file. It's been really useful to me. Here: http://blog.demetriusnunes.com/past/2009/6/7/looks_like_i_am_blogging_again/ Cheers, Demetrius -- http://www.demetriusnunes.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: ActiveRecord Classes
Just to throw another spanner in the works for you, I wonder if this wouldn't be achieved more easily using scRUBYt!. The latest skimr branch (http://github.com/scrubber/scrubyt/tree/skimr) lets you quite easily store the results of a scrape directly into an ActiveRecord model. Drop me a line if you need me to provide a more concrete example. Glenn --~--~-~--~~~---~--~~ 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 can i get attribute values from xml using libxml
try doc.find('//Root/s...@category=601]') On Mon, 08 Jun 2009 21:09:06 +0800, lecielbleu canal...@gmail.com wrote: Hi , i have xml document like this ?xml version=1.0 encoding=ISO-8859-9? RootStk Category=601 Group=60101 Brand=001 then i have to use Category attribute but reader class couldnt recognize attributes when i use these codes below for testing; while reader.read puts reader.node_type end it shows only 1 and 15 values which means XML_READER_TYPE_ELEMENT = 1 XML_READER_TYPE_END_ELEMENT = 15 how can i get attribute values? i tried another method doc = reader.expand doc.find('//Root/Stk/[Category='601']') but it also didnt work --~--~-~--~~~---~--~~ 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: {ActionController] Default route naming
Lee Smith wrote: Looks fine to me...what are you expecting the route to be? Yes, I confused myself by using both named routes and resources. That and I got caught by Rails inflection system as forex has no plural so that the index action becomes forex_index GET, rather than forexes GET. I ended up with this sort of thing instead: map.forex_by_currency_and_date \ '/forex/:currency_code/:year/:month/:day', ... map.forex_by_currency \ '/forex/:currency_code', ... map.forex_by_date \ '/forex/:year/:month/:day', ... map.resources :forex, :type = 'CABK', :controller = 'currency_exchange_rates', :only = [:index, :show] # Note that because forex has no plural form registered in inflections # the generated index route is named forex_index -- 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: Missing Template when testing with the Brain Buster Captcha partial
My original suggestion was based on the error message: ActionView::TemplateError: Missing template /_captcha.erb in view path app/views:test/vendor/plugins/brain_buster/views/brain_busters The partial you called out was render :partial = '/captcha' Your new error is clearly that the @captcha instance variable has no value in the partial. Have you tried something like: render :partial = 'captcha', :object = @captcha and then within your _captcha.html.erb template using a local variable: %= hidden_field_tag :captcha_id, captcha.id % -Rob Rob Biedenharn http://agileconsultingllc.com r...@agileconsultingllc.com On Jun 7, 2009, at 7:16 PM, Matt W. wrote: Just to experiment, I used this instead: %= render :partial = #{RAILS_ROOT}/vendor/plugins/brain_buster/ views/brain_busters/captcha.html.erb unless action_name == 'edit' % and now I get the following error: ActionView::TemplateError: Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id On line #4 of vendor/plugins/brain_buster/views/brain_busters/ _captcha.html.erb 1: % unless captcha_passed? % 2: span id=brain_buster_captcha class=%= if last_captcha_attempt_failed? then 'captcha_failed' end % 3: 4: %= hidden_field_tag :captcha_id, @captcha.id % 5: 6: label for=captcha_answer 7: Spam protection: %= @captcha.question % vendor/plugins/brain_buster/views/brain_busters/ _captcha.html.erb:4 app/views/contacts/_form.html.erb:23 app/views/contacts/_form.html.erb:1 app/views/contacts/edit.html.erb:1 app/controllers/contacts_controller.rb:41:in `update' functional/contacts_controller_test.rb:80:in `__bind_1244416417_125477' /usr/local/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.1/ lib/shoulda/context.rb:271:in `call' /usr/local/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.1/ lib/shoulda/context.rb:271:in `run_current_setup_blocks' /usr/local/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.1/ lib/shoulda/context.rb:270:in `each' /usr/local/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.1/ lib/shoulda/context.rb:270:in `run_current_setup_blocks' /usr/local/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.1/ lib/shoulda/context.rb:252:in `test: on PUT to :update with invalid params should assign @contact with a kind of Contact. ' /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each' /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run' /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run' /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each' /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run' /usr/local/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb: 46:in `run_suite' /usr/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb: 67:in `start_mediator' /usr/local/lib/ruby/1.8/test/unit/ui/console/testrunner.rb: 41:in `start' /usr/local/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb: 29:in `run' /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run' /usr/local/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run' /usr/local/lib/ruby/1.8/test/unit.rb:278 functional/contacts_controller_test.rb:88 I feel like after that point I'm just chasing the white rabbit, seems that once I figure out the initial problem, things should be okay. On Jun 7, 2:27 pm, Rob Biedenharn r...@agileconsultingllc.com wrote: Take off the slash? %= render :partial = 'captcha' unless action_name == 'edit' % -Rob Rob Biedenharn http://agileconsultingllc.com r...@agileconsultingllc.com On Jun 7, 2009, at 12:22 AM, Matt W. wrote: When I run my functional tests, they throw an error with the following message: ActionView::TemplateError: Missing template /_captcha.erb in view path app/views:test/vendor/plugins/brain_buster/views/brain_busters On line #23 of app/views/contacts/_form.html.erb 20: %= f.label :message %br / 21: %= f.text_area :message % 22: /div 23: %= render :partial = '/captcha' unless action_name == 'edit' % 24: div%= f.submit Submit %/div 25: % end % app/views/contacts/_form.html.erb:23 app/views/contacts/_form.html.erb:1 app/views/contacts/edit.html.erb:1 app/controllers/contacts_controller.rb:41:in `update' I've checked to make sure the partial is in the right location, it is in this directory: /vendor/plugins/brain_buster/views/brain_busters/_captcha.html.erb Any ideas as to why the test can't find the partial? It works fine when I test it manually (via the browser).
[Rails] Re: how can i get attribute values from xml using libxml
Thanks a lot Simon , it worked , can we double this filter method like category=601 and brand=15 at the same time On Jun 8, 4:32 pm, Simon Macneall macne...@gmail.com wrote: try doc.find('//Root/s...@category=601]') On Mon, 08 Jun 2009 21:09:06 +0800, lecielbleu canal...@gmail.com wrote: Hi , i have xml document like this ?xml version=1.0 encoding=ISO-8859-9? RootStk Category=601 Group=60101 Brand=001 then i have to use Category attribute but reader class couldnt recognize attributes when i use these codes below for testing; while reader.read puts reader.node_type end it shows only 1 and 15 values which means XML_READER_TYPE_ELEMENT = 1 XML_READER_TYPE_END_ELEMENT = 15 how can i get attribute values? i tried another method doc = reader.expand doc.find('//Root/Stk/[Category='601']') but it also didnt work --~--~-~--~~~---~--~~ 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: Export to pdf (graph output)
You can do it inside the PDF, this would make a lighter file, and a vector graph, wich behaves nice with zoom and print. Inside PDF::Writer's Manual (http://ruby-pdf.rubyforge.org/pdf-writer/) you have a Graphics part, there are good examples. Regards. Franco Catena. On Jun 8, 5:33 am, blueomega celsoricardoco...@gmail.com wrote: So i have tasks, with start time, end time, the usual stuff, and i need to export all the info to pdf (description, owner, relations, etc) Export text to pdf shouldn't be a problem, there are many tutorials who explain it I also need to export a gant chart (need some way to make a screenshot from the gantt i have, or make it from the data). making it from data would be perfect, some eye candy, would also be good. Graphviz was what come to mind to do it, is it the best? should i use an alternative(something to make charts). So what gems should i use, do you know a tutorials who implements similar stuff? Cumps Celso Costa --~--~-~--~~~---~--~~ 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: Pagination: Last Page
Patrick Heneise wrote: Hi Folks is there any way to link to the last page of a paginated list, if the number of pages is not available in this moment? For example a forum with topic and replies. I'd like to link to the last page of the replies, but I don't know how many pages there are in the forum view? I'm using mislav-will_paginate for pagination. Thank you in advance! If you have an object that you have paginated, you can get the number of pages with .total_pages: this will be the same as the number of the last page. Presumably when you're looking at the topic, you've already loaded it's replies anyway? eg @topic = Topic.find(params[:id]) @replies = @topic.replies.paginate(:page = 1, :per_page = 20) last_page = @replies.total_pages -- 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: Rails Code Indentation
Hi guys, Thanks for your reply ! I am using vi editor with rails.vim plugin as well as my own personal indentation settings for my current developments. but i think there should be plugin/gem to indent your rails application directory LIKE annotate models plugin ( Lazy peoples ). sorry to say but i don't wanted to indent my previous developments using editors. - Sandip R~ On Mon, Jun 8, 2009 at 1:36 AM, Scott Tamosunas tamosu...@gmail.com wrote: RubyMine has an excellent code formatter. Just write your code and Cmd- Option-L. Scott On Jun 7, 9:07 am, prabesh shrestha prabesh...@gmail.com wrote: Netbeans is good for that. On Jun 7, 8:04 am, Mohit Sindhwani mo_m...@onghu.com wrote: JannaB wrote: What do you use asa good RoR editor then? NetBeans indents very well. Cheers, Mohit. 6/7/2009 | 11:03 AM. -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.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] How to delete all records in a table using a link
I've been looking around and can't seem to find something that shows how to do this.. My controller is rushing_offenses_controller.rb My model is rushing_offense.rb I'd like to use something similar but I'm not all that familiar with REST. %= link_to 'Destroy All', @rushing_offenses.all.destroy!, :confirm = 'Are you sure?', :method = :delete % I have a method in my controller called destroyall which does: def destroyall @rushing_offense = RushingOffense.find(:all) @rushing_offense.destroy respond_to do |format| format.html { redirect_to(rushing_offenses_url) } format.xml { head :ok } end end I simply want to place a link on one of my pages that when clicked, it destroys all of the data inside the table (but not the table or model itself) and then redirects back to the main page which is @rushing_offenses. 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] Re: Rails way to do long running tasks
@Bharat, Can you give brief why to use javan instead backgroundrb ? As, i am using backgroundrb for heavy upload duties and it works fine for me. - Sandip R~ On Sun, Jun 7, 2009 at 11:26 PM, Bharat bcrupa...@yahoo.com wrote: Two pointers from personal experience: 1. Don't use backgroundrb for asynchronous processing 2. Do use javan-whenever to automate your cron jobs (available on Github) Bharat -- Ruby on Rails Developer http://sandip.sosblog.com http://funonrails.wordpress.com www.joshsoftware.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: Export to pdf (graph output)
thx man, in my online searches, to draw the gantt, i would need to combine more than one gem (one to draw and then export as image, other to send it to a pdf) this seems good, gonna wrestle a bit with it Regards Celso Costa On 8 Jun, 15:05, Franco Catena francocat...@gmail.com wrote: You can do it inside the PDF, this would make a lighter file, and a vector graph, wich behaves nice with zoom and print. Inside PDF::Writer's Manual (http://ruby-pdf.rubyforge.org/pdf-writer/) you have a Graphics part, there are good examples. Regards. Franco Catena. On Jun 8, 5:33 am, blueomega celsoricardoco...@gmail.com wrote: So i have tasks, with start time, end time, the usual stuff, and i need to export all the info to pdf (description, owner, relations, etc) Export text to pdf shouldn't be a problem, there are many tutorials who explain it I also need to export a gant chart (need some way to make a screenshot from the gantt i have, or make it from the data). making it from data would be perfect, some eye candy, would also be good. Graphviz was what come to mind to do it, is it the best? should i use an alternative(something to make charts). So what gems should i use, do you know a tutorials who implements similar stuff? Cumps Celso Costa --~--~-~--~~~---~--~~ 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: XML::LibXML::Reader
Glad it is working. Jeff Quoting lecielbleu canal...@gmail.com: ok Jeff i solved problem , using doc was a bad mistake :) thanks for your support ,here is the last codes while reader.read case reader.name when Brand_name name_from_xml = reader.read_string Brand.create( :name = name_from_xml ) end end now i have to solve another problem :) do you know how can i get a brand_name using filter brand_id while reader.read case reader.read_string when 55 ---magic line i couldnt find :) -- end end magic line must be get brand_name value Dell using 55 Sample xml code === BrandBrand_id55/Brand_idBrand_nameDell/ Brand_name/Brand On Jun 4, 9:36 pm, Jeffrey L. Taylor r...@abluz.dyndns.org wrote: I'm afraid I don't understand what you are trying to do here. 'doc' isn't in the example below. So how the loop would change its value, I am unclear. It seems like you are saying a loop with an unchanging condition runs forever. Yes, it does. Did you intend to do this: while reader.read puts reader.read_string end HTH Jeff Quoting lecielbleu canal...@gmail.com: i tried also while doc == true while doc = 1 while doc results dont change On Jun 4, 12:51 pm, lecielbleu canal...@gmail.com wrote: i guess problem is while reader line because when i run basic code below : while doc == true puts reader.read_string end strings never stops in the command line , it turns infinite loop. On Jun 4, 12:48 am, Jeffrey L. Taylor r...@abluz.dyndns.org wrote: There are no xml header tags. I have no idea how libXML will behave. It isn't very tolerant of invalid input. Try adding the puts statements I've inserted below to find out how far it is getting. Quoting lecielbleu canal...@gmail.com: my xml data seems like that : BrandsBrandBrand_id2/ Brand_idBrand_nameHP/Brand_name/Brand and here is my codes def xml_testing require'xml' reader = XML::Reader.file('c:/brands.xml') stack = [] while reader case reader.node_type when XML::Reader::TYPE_ELEMENT # opening tag stack reader.name puts BEGIN #{stack.join('/')} stack.pop if reader.empty_element? puts END #{stack.join('/')} if reader.empty_element? when XML::Reader::TYPE_TEXT, XML::Reader::TYPE_CDATA path = stack.join('/') case path when 'Brands/Brand/Brand_name' puts reader.value # simple content when XML::Reader::TYPE_END_ELEMENT # closing tag puts END #{stack.join('/')} stack.pop end end end flash.now[:message]=brands read 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 -~--~~~~--~~--~--~---
[Rails] Re: How to get value from view?
On Mon, Jun 8, 2009 at 5:05 AM, Vikas Gholaprails-mailing-l...@andreas-s.net wrote: Hello all, I have following problem, I have a view called new_sub_type.html.haml and controller SubscriptionTypes. In this view i'm showing a dropdown list of subscription types. When user submit form, I show another view new_credit_card.html.haml which is in controller CreditCards. This form is submitted to SubscriptionTypes controller. Then i validate credit card information in SubscriptionTypes controller. if credit card info is not valid then i redirect to again credit cards new.html. Redirecting will lose state. I think instead of redirecting you want to render the new template, normally this is done within the same controller but if you really have to render a view from a different controller then render :action = 'new', :controller = :credit_cards should do the trick, assuming you set up the controller instance variables which the view (and any partials) expects. but really your description sounds a bit complex, I'd look at trying to get away from jumping between controllers. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale --~--~-~--~~~---~--~~ 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 delete all records in a table using a link
2009/6/8 J. D. rails-mailing-l...@andreas-s.net: I've been looking around and can't seem to find something that shows how to do this.. My controller is rushing_offenses_controller.rb My model is rushing_offense.rb I'd like to use something similar but I'm not all that familiar with REST. %= link_to 'Destroy All', @rushing_offenses.all.destroy!, :confirm = 'Are you sure?', :method = :delete % I have a method in my controller called destroyall which does: def destroyall �...@rushing_offense = RushingOffense.find(:all) �...@rushing_offense.destroy respond_to do |format| format.html { redirect_to(rushing_offenses_url) } format.xml { head :ok } end end I simply want to place a link on one of my pages that when clicked, it destroys all of the data inside the table (but not the table or model itself) and then redirects back to the main page which is @rushing_offenses. Are you sure that is a good idea? What will happen when google follows the link? It might be better as a post rather then a get. 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] Connecting to SQLServer
New to rails. Installed rails on my XP desktop, and setup my first app that will use an existing SQLServer database. I am able to connect to SQLServer using odbc with following code. require 'rubygems' require 'ActiveRecord' ActiveRecord::Base.establish_connection( :adapter = 'sqlserver', :mode = 'odbc', :dsn = 'Driver={SQL Server};Server=server;Database=db', :username = 'uid', :password = 'pwd' ) class src ActiveRecord::Base set_table_name 'Source' set_primary_key 'IDSource' end s = [] s = Source.find(1) puts s.SourceName I was able to connect and the code behaves as expected. However when I try to use database.yml to specify the same connection information, I am unable to connect using script/dbconsole. #database.yml development: adapter : sqlserver mode : odbc dsn : Driver={SQL Server};Server=server;Database=db username : uid password : pwd When I start script/dbconsole, the error is D:\work\rails\jobruby script/dbconsole Unknown command-line client for db. Submit a Rails patch to add support! My assumption is that my database.yml does not describe the connection properly, since I am able to connect directly using establish_connection method. Is there any documentation on how to specify a odbc connection in yml for rails? Here is the list of installed gems :: D:\work\rails\jobgem list *** LOCAL GEMS *** actionmailer (2.3.2, 2.0.0) actionpack (2.3.2, 2.0.0) activerecord (2.3.2, 2.0.0) activerecord-sqlserver-adapter (2.2.18) activeresource (2.3.2) activesupport (2.3.2, 2.0.0) dbd-odbc (0.2.4) dbi (0.4.1) deprecated (2.0.1) fxri (0.3.7, 0.3.6) fxruby (1.6.19, 1.6.12) hpricot (0.8.1, 0.6) log4r (1.0.5) ptools (1.1.6) rails (2.3.2) rake (0.8.7, 0.7.3) sources (0.0.1) test-unit (2.0.2) win32-api (1.4.2, 1.0.4) win32-clipboard (0.5.1, 0.4.3) win32-dir (0.3.4, 0.3.2) win32-eventlog (0.5.0, 0.4.6) win32-file (0.6.1, 0.5.4) win32-file-stat (1.3.3, 1.2.7) win32-process (0.6.0, 0.5.3) win32-sapi (0.1.4) win32-sound (0.4.1) windows-api (0.3.0, 0.2.0) windows-pr (1.0.5, 0.7.2) Thanks and appreciate any help leading to the resolution. -- 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: cPanel Ruby Gems
Matt Jones wrote: This looks like a host problem of some sort - the segmentation faults are a problem that older versions of Rubygems had, where they would try to load the entire RubyForge gem listing into memory (and then fail). The 1.3.1 Rubygems now only tries to load 1000 items, so either cPanel's hitting an old version, or your host's memory limits are tiny. I'd recommend opening a ticket with your hosting provider to sort this out. --Matt Jones Thanks for the reply Matt, What would you suggest me to raise with my host then? Is it ruby gems that is out of date? Should I suggest a whole upgrade of Ruby/Rails/Gems? I am running; Rails 2.0.2 Gems 1.3.1 Ruby 1.8.6 Thanks a lot, Rob -- 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: How to delete all records in a table using a link
Colin Law wrote: 2009/6/8 J. D. rails-mailing-l...@andreas-s.net: %= link_to 'Destroy All', @rushing_offenses.all.destroy!, :confirm = format.xml { head :ok } end end I simply want to place a link on one of my pages that when clicked, it destroys all of the data inside the table (but not the table or model itself) and then redirects back to the main page which is @rushing_offenses. Are you sure that is a good idea? What will happen when google follows the link? It might be better as a post rather then a get. Colin Hi Colin, I'm just going to be using it for my development platform. I simply want a link so that I can quickly remove all data in a particular table and then be able to re-populate it with some new data.. Can you provide me with a way to do that? -- 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: How to delete all records in a table using a link
2009/6/8 J. D. rails-mailing-l...@andreas-s.net: Colin Law wrote: 2009/6/8 J. D. rails-mailing-l...@andreas-s.net: %= link_to 'Destroy All', @rushing_offenses.all.destroy!, :confirm = format.xml { head :ok } end end I simply want to place a link on one of my pages that when clicked, it destroys all of the data inside the table (but not the table or model itself) and then redirects back to the main page which is @rushing_offenses. Are you sure that is a good idea? What will happen when google follows the link? It might be better as a post rather then a get. Colin Hi Colin, I'm just going to be using it for my development platform. I simply want a link so that I can quickly remove all data in a particular table and then be able to re-populate it with some new data.. Can you provide me with a way to do that? Actually I was talking rubbish, the :method = :delete will make it a post. I think you want something like %= link_to 'Destroy All', :action = 'destroyall', :confirm = 'Are you sure?', :method = :delete % but you might need something in routes as well, I am not sure. Colin -- 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: Connecting to SQLServer
On Jun 8, 4:23 pm, Steve Dc rails-mailing-l...@andreas-s.net wrote: New to rails. Installed rails on my XP desktop, and setup my first app that will use an existing SQLServer database. I am able to connect to SQLServer using odbc with following code. require 'rubygems' require 'ActiveRecord' ActiveRecord::Base.establish_connection( :adapter = 'sqlserver', :mode = 'odbc', :dsn = 'Driver={SQL Server};Server=server;Database=db', :username = 'uid', :password = 'pwd' ) class src ActiveRecord::Base set_table_name 'Source' set_primary_key 'IDSource' end s = [] s = Source.find(1) puts s.SourceName I was able to connect and the code behaves as expected. However when I try to use database.yml to specify the same connection information, I am unable to connect using script/dbconsole. script/dbconsole is just a handy shortcut for opening a connection to the database using whatever command line tool that database provides (eg with mysql it just runs the mysql utility). What rails is telling you here is that it doesn't know what it should launch for this kind of database (which isn't entirely surprising what with the sqlserver being unbundled from rails). This isn't actually related to the ability to connect to the database from a rails app though. Fred #database.yml development: adapter : sqlserver mode : odbc dsn : Driver={SQL Server};Server=server;Database=db username : uid password : pwd When I start script/dbconsole, the error is D:\work\rails\jobruby script/dbconsole Unknown command-line client for db. Submit a Rails patch to add support! My assumption is that my database.yml does not describe the connection properly, since I am able to connect directly using establish_connection method. Is there any documentation on how to specify a odbc connection in yml for rails? Here is the list of installed gems :: D:\work\rails\jobgem list *** LOCAL GEMS *** actionmailer (2.3.2, 2.0.0) actionpack (2.3.2, 2.0.0) activerecord (2.3.2, 2.0.0) activerecord-sqlserver-adapter (2.2.18) activeresource (2.3.2) activesupport (2.3.2, 2.0.0) dbd-odbc (0.2.4) dbi (0.4.1) deprecated (2.0.1) fxri (0.3.7, 0.3.6) fxruby (1.6.19, 1.6.12) hpricot (0.8.1, 0.6) log4r (1.0.5) ptools (1.1.6) rails (2.3.2) rake (0.8.7, 0.7.3) sources (0.0.1) test-unit (2.0.2) win32-api (1.4.2, 1.0.4) win32-clipboard (0.5.1, 0.4.3) win32-dir (0.3.4, 0.3.2) win32-eventlog (0.5.0, 0.4.6) win32-file (0.6.1, 0.5.4) win32-file-stat (1.3.3, 1.2.7) win32-process (0.6.0, 0.5.3) win32-sapi (0.1.4) win32-sound (0.4.1) windows-api (0.3.0, 0.2.0) windows-pr (1.0.5, 0.7.2) Thanks and appreciate any help leading to the resolution. -- 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: To deploy or not to deploy on App Engine
Do you use active record on your project? If so, google app engine is not for you. Take a look at this post, it explains some of the limitations: http://olabini.com/blog/2009/04/jruby-on-rails-on-google-app-engine/ regards, Leonardo Borges www.leonardoborges.com On Jun 8, 2:44 pm, tashfeen.ekram tashfeen.ek...@gmail.com wrote: I am nearing the end on a project i have been working on and am trying to figure out where to host it. I am very tempted to host it on google's app engine. you get a ton of space, band width, and processor all for free! I was hoping to get some advice as to what people think about deplying on the app engine. Would it better to wait until ruby is supported? Are there perfomrance issues with using JRuby? What would happen if ruby were supported in the future, would transfering be a pain? --~--~-~--~~~---~--~~ 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 do restful_authentication generated rspec tests fail
Jonathan wrote: Many thanks for the explanation. Just what I needed to know. On Jun 8, 2:00�am, Maur�cio Linhares mauricio.linha...@gmail.com There are several forks of restful_authentication that have fixed the rSpec failures, including mine at: http://github.com/robertwalker/restful-authentication/tree/master There is nothing different in my fork except the fixes for the specs. -- 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: Iconv::InvalidEncoding (ISO-8859-1, UTF-8)
Quoting Ariel Sch rails-mailing-l...@andreas-s.net: Hi, I'm having the error: Iconv::InvalidEncoding: invalid encoding (ISO-8859-1, UTF-8) when trying to post via Mechanize. It used to work just fine, but the error appeared after (I think) upgrading to Rails 2.3.2, Ruby 1.8.7, Mechanize 0.9.2 (I upgraded a while ago and only now noticed the problem). What does it mean? Is there any way to disable/bypass the error? Any help would be much appreciated! Two things, try without the double quotes in the first argument (unless this is just a transcription error), and have you checked that there is no invalid codes in the input, i.e. that the input is truely ASCII or Latin-1? I have similar errors but every time I've looked, it is because the source has garble in it. Latin-1 but they claim it is UTF-8 (these are RSS feeds), or no encoding info at all (perhaps some Windows encoding). I have not figured out how to get Iconv to recover from errors; if you do, please post the solution here. Jeffrey --~--~-~--~~~---~--~~ 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: To deploy or not to deploy on App Engine
Leonardo Borges wrote: Do you use active record on your project? If so, google app engine is not for you. That may be true, but Ola's post explains how to connect Rails to the Google DataStore instead. So you may not need ActiveRecord. (No, I've never actually done this.) Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- 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: Access values with has_and_belongs_to_many assocciation
Thank u all. Colin sorry for my previous question i found the sollution i wanted. There is something else i want to do. I calculate the size of this array. If the size is less than 2, i want to see the name of the author, and if there are more than 2 authors i want to see both names with a party-comma between them. here is the code so far: % if (product.authors.map(:name).size) 2 % %= Author: Here i should see the name of the author % % else % %= Authors: Here i should see all the authors name separated with a party-comma.% % end % How can i do that? Thank u for your time again! Kostas 2009/6/6 Konstantinos Loupos loup...@gmail.com: Sijo, map works great! but is there any other way showing the title but not using map? I am curious because i've been searching for this but i found nothing. What exactly do you mean by 'showing the title'. The map function returns an array containing the titles of all the products. What is it that you are trying to achieve? Colin Thank u Kostas On Thu, Jun 4, 2009 at 7:08 AM, Sijo Kg rails-mailing-l...@andreas-s.net wrote: To get all the products titles of my_author you can do like my_author.products.map(:title) Sijo -- Posted via http://www.ruby-forum.com/. -- Κωνσταντίνος Λούπος loup...@gmail.com -- Κωνσταντίνος Λούπος loup...@gmail.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: how can i get attribute values from xml using libxml
See in-line code additions Quoting lecielbleu canal...@gmail.com: Hi , i have xml document like this ?xml version=1.0 encoding=ISO-8859-9? RootStk Category=601 Group=60101 Brand=001 then i have to use Category attribute but reader class couldnt recognize attributes when i use these codes below for testing; while reader.read case reader.node_type when XML_READER_TYPE_ELEMENT case reader.name when 'Stk' puts reader['Category'] puts reader['Group'] end end puts reader.node_type end it shows only 1 and 15 values which means XML_READER_TYPE_ELEMENT = 1 XML_READER_TYPE_END_ELEMENT = 15 how can i get attribute values? --~--~-~--~~~---~--~~ 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: Problem with set-cookie?
Your server is running an old version of Passenger (2.0.6); this is a known issue with that version and Rails 2.3.2. Upgrading to the latest Passenger will fix it. --Matt Jones On Jun 8, 4:34 am, Joa Corb rails-mailing-l...@andreas-s.net wrote: Hello everyone, I'm a beginner in Ruby on Rails and I have a little problem when I update my application RoR in my server. Can you help me please? My problem is: When I code my application in my computer: It's ok. When I update my application in my server I have a bug with cookies. When a user come in my website for the first time, I initialize some cookies. But in my server I have a message in my page and the cookies isn't initialize: Set-Cookie: boite=1-2; path=/ Set-Cookie: _mileva2_session_id=BAh7CDoPc2Vzc2lvbl9pZCIlMzAyYjdlMjNiMzg5MDZlM2I3OTZlYTY 4MzZkYjdkMjciCmZsYXNoSUM6J0FjdGlvbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AA Y6CkB1c2VkewA6EF9jc3JmX3Rva2VuIjFHTDY3TmcvclhXeXIwTG5YcDlmbzBkOFU1eW1VQkNYN UVhU2d2Qm1DdUIwPQ%3D%3D--2ea57948c303a0b69628eb3b8798eba64ef4dd44; path=/; HttpOnly It's working perfectly in my computer and I searched the problem in different place but no result :( My version of rails is 2.3.2. A fragment of my code where I initialize the cookies: In welcome_controller.rb # 3 # Dans le cas où j'ai ni cookie, et que je suis pas loggué boite = Box.find( :all, :conditions = capsules.admin = '1' boxes.user_id = '0', :order = 'position', :group = 'capsule_id', :joins = inner join capsules on boxes.capsule_id = capsules.id ) @box = boite # Pour créer les starters et les closers @number = 8 - boite.length # Initialisation des cookies cookies[:user] = 'mileva' cookie_text = j = 0 for box in boite if(j = 1) cookie_text = cookie_text + - end cookie_text = cookie_text + box.capsule.id.to_s j = j + 1 end cookies[:boite] = cookie_text You can see the error inwww.mileva.eu(Warning, if you don't visit for the first time, you have to clear your cookies) Thank you and Have fun Joachim -- 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: How do i model this in Rails? (put down java equivalent design)
I'd also chime in that if you create a model named 'Module', Rails will most likely break in really interesting ways, as Module is a reserved word in Ruby... --Matt Jones On Jun 7, 3:12 am, Frederick Cheung frederick.che...@gmail.com wrote: On Jun 7, 3:29 am, Ritvvij ritvi...@gmail.com wrote: Hello guys, Need help!! Finding it hard to model the 'model' :P within the given rails associations. In java terms, my requirements are... There are 3 entities - module, chapter and activity. Chapter entity is a specilization of Module entity (inheritence) Activity entity is a specialization of Module entity (inheritence) And the tables would have looked like: 1. Module table = Module_Id, Entity_type, 2. Chapter = Chapter_id, . 3. Activity = Activity_id, .. Hence, if I create a chapter then the tables would be populated as: Module table = Module_Id, Entity_type, = values ( 100, chapter , ) Chapter table = chapter_id, . = values ( 100, ) Basically, the ids of chapter and module would be same and module table would store the type. That wouldn't be the rails way of doing it. In rails you'd probably either use single table inheritance or a polymorphic association. Fred Now, if I create a activity then the tables would be populated as: Module table = Module_Id, Entity_type, = values ( 101, activity , ) Activity table = activity_id, . = values ( 100, ) Basically, the ids of activity and module would be same and module table would store the type. Can you please guide me how I can model it similarly in rails 2.3.2? Thanks in advance Ritvvij Parrilkh --~--~-~--~~~---~--~~ 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: Use of Models - The Very Basics
Does that help? Yes, it does. So, I think that you are saying that, in the right circumstances, it's perfectly fine to create a model that inherits directly from object. That does help. FWIW, I'm still digesting Rob's response. I think that there is likely a lot of help there as well. I just need to sort it all out. Thanks for the input. ... doug --~--~-~--~~~---~--~~ 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: SSL before or after submit?
2009/6/8 Pål Bergström rails-mailing-l...@andreas-s.net: A general question regarding SSL and login. Does it matter if a login form is not passed through SSL when sent to the user browser but the post action is? Will the password be sent through SSL in this case? Both need to be wrapped in SSL for proper security. If the form is not SSL then people can do MITM attacks (among others) to get the username/password sent to the wrong server. -- Aaron Turner http://synfin.net/ http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix Windows Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin --~--~-~--~~~---~--~~ 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: SSL before or after submit?
Aaron Turner wrote: Both need to be wrapped in SSL for proper security. If the form is not SSL then people can do MITM attacks (among others) to get the username/password sent to the wrong server. Thanks for the clarification. :-) -- 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: Problem with set-cookie?
Thank you Matt, I will try it :) -- 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] date validation how to chech ArgumentError
I wrote in my user model : def validate errors.add(:born_on, is invalid) if Proc.new { |user| DateTime.parse(user.born_on) } end it's wrong I know, running in the console raises an ArgumentError Loading development environment (Rails 2.3.2) born_on = 99/99/ = 99/99/ DateTime.parse(born_on) ArgumentError: invalid date from /usr/local/lib/ruby/1.8/date.rb:1573:in `new_by_frags' from /usr/local/lib/ruby/1.8/date.rb:1618:in `parse' from (irb):2 how can I write my validation Proc ? thanks for your help erwin --~--~-~--~~~---~--~~ 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: Pagination: Last Page
Max Williams wrote: If you have an object that you have paginated, you can get the number of pages with .total_pages: this will be the same as the number of the last page. Presumably when you're looking at the topic, you've already loaded it's replies anyway? eg @topic = Topic.find(params[:id]) @replies = @topic.replies.paginate(:page = 1, :per_page = 20) last_page = @replies.total_pages Well, the problem is that the replies are not yet paginated. It's a summary on a landing-page and the last three replies should show up for each topic. The total_pages attribute is not know at this point. -- 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: how to edit a pluggin? (acts_as_taggable_on)
There is a funtion dot does this...I have seen it documented in the official site: # Options: # :exclude - Find models that are not tagged with the given tags # :match_all - Find models that match all of the given tags, not just one # :conditions - A piece of SQL conditions to add to the query # :on - scopes the find to a context Model.find_tagged_with(tag1, tag2, :on = :context1, :match_all = true) On 24 mayo, 18:35, aupayo cres...@gmail.com wrote: In case someone has the same problem: I have executed: rake gems:unpack So now the plugin is in the vendors/gem directory inside my rails proyect and when I edit it there, the changes take effect. However I haven't been able to obtain the functionality that I was looking for in acts_as_taggable_on with the change I made...any ideas? On 23 mayo, 19:27,aupayocres...@gmail.com wrote: Hello, I'm trying to modificate the acts_as_taggable_on pluggin, so when you search various tags (Eg: User.tagged_with(fish, cat, :on = :animals), it looks for users with BOTH tags, not just one of them. I have edited the file acts_as_taggable_on.rb and I have changed the line: conditions tags.map { |t| sanitize_sql([#{tags_alias}.name LIKE ?, t]) }.join( OR ) with conditions tags.map { |t| sanitize_sql([#{tags_alias}.name LIKE ?, t]) }.join( AND ). but when I execute the search, the sql sentence that is executed is the same than before. I just restarted the console after doing the changes, do I have to do something else so the changes take effect? (I installed the plugin through GemPlugins) Or maybe I'm editing the wrong line?...if someone has done this before please correct me if I'm wrong! 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: Running jQuery and prototype scripts together
Robby Russell wrote: You'll need to execute this after you load the jQuery file.. jQuery.noConflict(); Robby On Mon, May 25, 2009 at 11:06 AM, lyntaff l...@opaldesign.co.uk wrote: Many Thanks in advance. -- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting w/Ruby on Rails http://planetargon.com/ http://robbyonrails.com/ http://twitter.com/planetargon aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] Mine is the total opposite, maybe:), thats if my setup is configured correctly. I put my jquery-1.3.2.js in my projects /public/javascripts folder. I created a js script called jo.js in /public/javascripts that looks like this: $(document).ready(function() { $('a').click(function() { $('#box').fadeout('slow'); }); }); This is how I referenced the jo.js file in my html file: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head script src=/javascripts/jquery-1.3.2.js type=text/javascript/script titleindex/title %= javascript_include_tag jo.js % %= stylesheet_link_tag jcss % /head body div id=box/div a href=#Click Me!/a /body /html When i click on the click me link the box above it is supposed to fade out, this is not happening. 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] Re: how to edit a pluggin? (acts_as_taggable_on)
# Options: # :exclude - Find models that are not tagged with the given tags # :match_all - Find models that match all of the given tags, not just one # :conditions - A piece of SQL conditions to add to the query # :on - scopes the find to a context Model.find_tagged_with(tag1, tag2, :on = :context1, :match_all = true) On 24 mayo, 18:35, aupayo cres...@gmail.com wrote: In case someone has the same problem: I have executed: rake gems:unpack So now the plugin is in the vendors/gem directory inside my rails proyect and when I edit it there, the changes take effect. However I haven't been able to obtain the functionality that I was looking for in acts_as_taggable_on with the change I made...any ideas? On 23 mayo, 19:27,aupayocres...@gmail.com wrote: Hello, I'm trying to modificate the acts_as_taggable_on pluggin, so when you search various tags (Eg: User.tagged_with(fish, cat, :on = :animals), it looks for users with BOTH tags, not just one of them. I have edited the file acts_as_taggable_on.rb and I have changed the line: conditions tags.map { |t| sanitize_sql([#{tags_alias}.name LIKE ?, t]) }.join( OR ) with conditions tags.map { |t| sanitize_sql([#{tags_alias}.name LIKE ?, t]) }.join( AND ). but when I execute the search, the sql sentence that is executed is the same than before. I just restarted the console after doing the changes, do I have to do something else so the changes take effect? (I installed the plugin through GemPlugins) Or maybe I'm editing the wrong line?...if someone has done this before please correct me if I'm wrong! 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: SSL before or after submit?
Aaron Turner wrote: 2009/6/8 P�l Bergstr�m rails-mailing-l...@andreas-s.net: A general question regarding SSL and login. Does it matter if a login form is not passed through SSL when sent to the user browser but the post action is? Will the password be sent through SSL in this case? Both need to be wrapped in SSL for proper security. If the form is not SSL then people can do MITM attacks (among others) to get the username/password sent to the wrong server. Besides that, users expect to see the lock (and https) on the page with the login form. I'd be leery of any site that contained a username/password that was not contained within a secure page. Plus there's no good reason not to secure the login form's page. -- 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: Connecting to SQLServer
Frederick Cheung wrote: On Jun 8, 4:23�pm, Steve Dc rails-mailing-l...@andreas-s.net wrote: � :dsn = 'Driver={SQL Server};Server=server;Database=db', s = Source.find(1) puts s.SourceName I was able to connect and the code behaves as expected. However when I try to use database.yml to specify the same connection information, I am unable to connect using script/dbconsole. script/dbconsole is just a handy shortcut for opening a connection to the database using whatever command line tool that database provides (eg with mysql it just runs the mysql utility). What rails is telling you here is that it doesn't know what it should launch for this kind of database (which isn't entirely surprising what with the sqlserver being unbundled from rails). This isn't actually related to the ability to connect to the database from a rails app though. Fred Thanks Fred. I will ignore this issue and move on. But next this is where I am stuck. I have the following code in app/controllers/processjobs_controller.rb # class ProcessJobsController ApplicationController def index @ProcessJobs = ProcessJobs.find(:all) end end # This is my route file .. ActionController::Routing::Routes.draw do |map| map.resources :ProcessJobs map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' end When I point my browser to localhost:3000/ProcessJobs, this is what I see in the log file. When I see the first few lines, it appears that rails is trying to logon as 'sa'. The database.yml file has the following contents. development: adapter : sqlserver mode : odbc dsn : Driver={SQL Server};Server=server database : ODS username : definitely_not_sa password : pwd The log file also shows this : NameError (uninitialized constant ProcessJobsController) Not sure how to interpret this message. The contents of the log file follows: /!\ FAILSAFE /!\ Mon Jun 08 08:42:58 -0500 2009 Status: 500 Internal Server Error 28000 (18456) [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sa'. d:/ruby/lib/ruby/gems/1.8/gems/dbd-odbc-0.2.4/lib/dbd/odbc/driver.rb:36:in `connect' d:/ruby/lib/ruby/gems/1.8/gems/dbi-0.4.1/lib/dbi/handles/driver.rb:33:in `connect' d:/ruby/lib/ruby/gems/1.8/gems/dbi-0.4.1/lib/dbi.rb:142:in `connect' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-2.2.18/lib/active_record/connection_adapters/sqlserver_adapter.rb:775:in `connect' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-2.2.18/lib/active_record/connection_adapters/sqlserver_adapter.rb:211:in `initialize' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-2.2.18/lib/active_record/connection_adapters/sqlserver_adapter.rb:26:in `new' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-2.2.18/lib/active_record/connection_adapters/sqlserver_adapter.rb:26:in `sqlserver_connection' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout' d:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:9:in `cache' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:28:in `call' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
[Rails] Re: Deployment Question
Huh! What is overkill with GlassFish? With glassfish v3 server, you can deploy your Rails application without any packaging. Just to run your Rails app on a Java server should not ask you to package it as WAR file. Get glassfish v3 preview from here: http://download.java.net/glassfish/v3-preview/release/glassfish-v3-preview.zip and try it it is fast, reliable and suports deployment of Rails applications developed on JRuby without any need to do any additional packaging/configuration etc. -vivek. 2009/6/7 Maurício Linhares mauricio.linha...@gmail.com Don't use the glassfish app server for that, it's overkill, use a lightweight solution like jetty - http://jetty.mortbay.com/ Download the binary, generate a war file for your project using warbler and then copy the .war file to the your jetty install folder/webapps. Start jetty and the application should be available at http://localhost:8080/war_file_name;. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Sun, Jun 7, 2009 at 7:16 PM, Vivek Pandeyvivek.pan...@gmail.com wrote: To host multiple applications, on the same server, you should be using the glassfish application server (not glassfish gem). So , let say you have a running glassfish v3 server and lets say you have two apps in directories ~/apps1 ~/apps2 You would deploy them as: asadmin deploy ~/apps1 asadmin deploy ~/apps2 Then you can access these apps at, http://localhost:80/apps1/ and http://localhost:80/apps2/ You also have option to package the Rails app as WAR file and deploy on GlassFish server. See warbler doc, http://caldersphere.rubyforge.org/warbler/. -vivek. On Sun, Jun 7, 2009 at 11:30 AM, JannaB mistressja...@hotmail.com wrote: If I am using only Glassfish, and deploying to say, port 80 how can I handle multiple sites (multiple rails root dirs) on the same machine? -JannaB On Jun 5, 1:12 pm, Vivek Pandey vivek.pan...@gmail.com wrote: Vivek, you might want to create a screencast on how to deploy a Rails application using JRuby and Glassfish. This will be helpful to others that want to use JRuby as well as disprove some of the negative myths attached to it. There are several articles/blogs/wikis entries that describe running Rails on GlassFish server as well as glassfish gem. To get started see Charles Nutter blog on Easy deployment with Glassfish gem at: http://blog.headius.com/2009/04/apache-jruby-rails-glassfish-easy.html I should have a new screen cast on Deployment of Rails/Merb/Sinatra on GlassFish gem soon. -vivek. -Conrad --~--~-~--~~~---~--~~ 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: Deployment Question
Using the full Glassfish applicaiton server to host many Rails applications at the same time is overkill and a waste of resources. Someone trying to get many applications to run at the same time with just one server are really better served using a lightweight solution like Jetty or maybe even Tomcat (but I woudn't recommend using the later). Look that we're not talking about hosting just one application (which was Janna's problem at the beginning and to which I said that using the Glassfish gem would do it nicely) but hosting many applications at the same time. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Jun 8, 2009 at 3:24 PM, Vivek Pandeyvivek.pan...@gmail.com wrote: Huh! What is overkill with GlassFish? With glassfish v3 server, you can deploy your Rails application without any packaging. Just to run your Rails app on a Java server should not ask you to package it as WAR file. Get glassfish v3 preview from here: http://download.java.net/glassfish/v3-preview/release/glassfish-v3-preview.zip and try it it is fast, reliable and suports deployment of Rails applications developed on JRuby without any need to do any additional packaging/configuration etc. -vivek. 2009/6/7 Maurício Linhares mauricio.linha...@gmail.com Don't use the glassfish app server for that, it's overkill, use a lightweight solution like jetty - http://jetty.mortbay.com/ Download the binary, generate a war file for your project using warbler and then copy the .war file to the your jetty install folder/webapps. Start jetty and the application should be available at http://localhost:8080/war_file_name;. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Sun, Jun 7, 2009 at 7:16 PM, Vivek Pandeyvivek.pan...@gmail.com wrote: To host multiple applications, on the same server, you should be using the glassfish application server (not glassfish gem). So , let say you have a running glassfish v3 server and lets say you have two apps in directories ~/apps1 ~/apps2 You would deploy them as: asadmin deploy ~/apps1 asadmin deploy ~/apps2 Then you can access these apps at, http://localhost:80/apps1/ and http://localhost:80/apps2/ You also have option to package the Rails app as WAR file and deploy on GlassFish server. See warbler doc, http://caldersphere.rubyforge.org/warbler/. -vivek. On Sun, Jun 7, 2009 at 11:30 AM, JannaB mistressja...@hotmail.com wrote: If I am using only Glassfish, and deploying to say, port 80 how can I handle multiple sites (multiple rails root dirs) on the same machine? -JannaB On Jun 5, 1:12 pm, Vivek Pandey vivek.pan...@gmail.com wrote: Vivek, you might want to create a screencast on how to deploy a Rails application using JRuby and Glassfish. This will be helpful to others that want to use JRuby as well as disprove some of the negative myths attached to it. There are several articles/blogs/wikis entries that describe running Rails on GlassFish server as well as glassfish gem. To get started see Charles Nutter blog on Easy deployment with Glassfish gem at:http://blog.headius.com/2009/04/apache-jruby-rails-glassfish-easy.html I should have a new screen cast on Deployment of Rails/Merb/Sinatra on GlassFish gem soon. -vivek. -Conrad --~--~-~--~~~---~--~~ 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: Deployment Question
2009/6/8 Maurício Linhares mauricio.linha...@gmail.com: ...or maybe even Tomcat (but I woudn't recommend using the later). ? Because ? -- Hassan Schroeder hassan.schroe...@gmail.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: Deployment Question
Tomcat is famous for it's memory leaks and classloading issues, not really sure if they have improved it in anyway in this 6 version, but Tomcat 5 was a pain to get working specially if you used any of the Jakarta Commons libraries in your application. - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Jun 8, 2009 at 3:53 PM, Hassan Schroederhassan.schroe...@gmail.com wrote: 2009/6/8 Maurício Linhares mauricio.linha...@gmail.com: ...or maybe even Tomcat (but I woudn't recommend using the later). ? Because ? -- Hassan Schroeder hassan.schroe...@gmail.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: Deployment Question
Hassan Schroeder wrote: ...or maybe even Tomcat (but I woudn't recommend using the later). ? Because ? http://c2.com/cgi/wiki?ConfigurationHell -- Phlip http://c2.com/cgi/wiki?ConfigurationHell --~--~-~--~~~---~--~~ 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] Dynamically connecting a model to databases in a running app…?
Hi All, I've read many of the existing questions/threads on this subject, but keep in mind that none of them have directly addressed my issue -- or they have yet to be answered. Also keep in mind that this is NOT a situation for database.yml as I won't know the DB info in advance. That said, I need a solution for DYNAMICALLY connecting to multiple databases in a Rails app. My situation is that I have multiple data logging sites, all with a simple data table (EVENTS, TIMESTAMP, VALUE). These sites need to (and will) remain as they are due to local applications that need to use them. What I need is to create an application that maintains a table of MYSQL_LOGINS and uses each of those logins to connect to any one of various databases and provide charts/graphs for the data therein. My data model will remain the same for all MySQL databases to which I connect, I simply need to be able to tell my MODEL to connect to a different DB on the fly. I'm hoping this is amazingly simple, but we'll see. Best. --~--~-~--~~~---~--~~ 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: Deployment Question
2009/6/8 Maurício Linhares mauricio.linha...@gmail.com: Tomcat is famous for it's memory leaks and classloading issues, not really sure if they have improved it in anyway in this 6 version, but Tomcat 5 was a pain to get working specially if you used any of the Jakarta Commons libraries in your application. ? I've never had (or heard of) any such problems, and I've been using Tomcat for Java apps since the 3.x days. And right now I have a multi-site production Tomcat 6.0.x server that's been up for nearly a year. And yes, I use various commons libraries on some of them. So I'd suggest your information is, at the least, out-of-date. -- Hassan Schroeder hassan.schroe...@gmail.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: SSL before or after submit?
Robert Walker wrote: Aaron Turner wrote: Besides that, users expect to see the lock (and https) on the page with the login form. I'd be leery of any site that contained a username/password that was not contained within a secure page. Plus there's no good reason not to secure the login form's page. A strong reason. I say the same. I hesitate if I don't see the lock and https. -- 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: Deployment Question
Well, maybe you're one of the lucky guys that never had them, try searching on Google for tomcat memory leaks, there's plenty of things about it, most of them related to the use and the inability to unload classes from the Jakarta commons libraries that Tomcat and the application both are using. But this isn't really a discussion for a ROR list ;) And I'd go for Jetty anyway - http://jetty.mortbay.com/ - Maurício Linhares http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr On Mon, Jun 8, 2009 at 4:04 PM, Hassan Schroederhassan.schroe...@gmail.com wrote: 2009/6/8 Maurício Linhares mauricio.linha...@gmail.com: Tomcat is famous for it's memory leaks and classloading issues, not really sure if they have improved it in anyway in this 6 version, but Tomcat 5 was a pain to get working specially if you used any of the Jakarta Commons libraries in your application. ? I've never had (or heard of) any such problems, and I've been using Tomcat for Java apps since the 3.x days. And right now I have a multi-site production Tomcat 6.0.x server that's been up for nearly a year. And yes, I use various commons libraries on some of them. So I'd suggest your information is, at the least, out-of-date. -- Hassan Schroeder hassan.schroe...@gmail.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] authlogic - error messages
Hi my name is Marcos. we've implemented authlogic in our project, but we need to replace the errors messages. for example: * is too short (minimum is 6 characters) # when you don't introduce your email for registration * is too short (minimum is 4 characters) # when you don't introduce a password * should look like an email address. # when you introduce something that it is not an email address * doesn't match confirmation #when the pass and the confirmation doesn't match where do i have to set the new messages and how? is it at the model o the controller? tanxs! -- 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: why do restful_authentication generated rspec tests fail
I'll look into your suggestion - thanks mate. -- 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] Rails Hosting Questions
Hi everyone, I use Hostgator as my hosting provider and I checked out the versions of the apps they are running: Linux CentOS: 5.3 Ruby: 1.8.5 Rails: 2.3.2 MySQL: 5.1.30 I've been programming on a windows box but I do have a virtual linux box setup (not for this particular model) - I wasn't even aware that people still used Ruby 1.8.5.. My current platform for development is: Windows Vista 32 Ruby: 1.9.1-p129 Rails: 2.3.2 MySQL: 5.1.30 Do you think that there will be some problems with my development platform when it goes over to production? What steps do you think I should take (I'm in the process of setting up a vbox for the exact specifications of my host) just in case the host setup doesn't work properly? Is there a better hosting provider than Gatorhost that will work well with Rails that houses the ability for me to setup my own environment? 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] Video sharing site.
Hi, we have a client who want a video sharing site and we are asking our self if Rails is good for it or if it's better with PHP. We see a lot of video sharing site with PHP but maybe one or two with ROR why? Is it that PHP is better for a video sharing site. What is your thought about that. PHP or ROR and why? -- 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: Access values with has_and_belongs_to_many assocciation
2009/6/8 Konstantinos Loupos loup...@gmail.com: Thank u all. Colin sorry for my previous question i found the sollution i wanted. There is something else i want to do. I calculate the size of this array. If the size is less than 2, i want to see the name of the author, and if there are more than 2 authors i want to see both names with a party-comma between them. here is the code so far: % if (product.authors.map(:name).size) 2 % %= Author: Here i should see the name of the author % % else % %= Authors: Here i should see all the authors name separated with a party-comma.% % end % No need to test for the special case of only one element, look up the docs for Array#join and try something like product.authors.map(:name).join(',') I am not sure what a party-comma is. The only thing this won't do is the s on the end of Author in the case of multiple. So you may need to do the test if you really need this. If so then product.authors.size 2 will do, no need to convert it to an array of names before checking the size. There is one thing to watch out for though in both cases, suppose product has no authors at all, then product.authors will be nil and you would get an exception trying to call map or size on nil. In this case you may want to display something else. One way to tidy this up so you don't end up with messy code in your view would be to add a method to the product model that returns the string you wish to see displayed and handles the nil case internally then the view would just contain %= product.authors_text % where authors_text is product model method. I think possibly you could usefully work through some basic tutorials on Ruby to get you going. 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: How to get value from view?
It seems like the two controllers could be combined. Validating the card and choosing a subscription type would be part of the same order, so you could add the subscription types to the credit card controller as an instance variable. On Jun 8, 5:05 am, Vikas Gholap rails-mailing-l...@andreas-s.net wrote: Hello all, I have following problem, I have a view called new_sub_type.html.haml and controller SubscriptionTypes. In this view i'm showing a dropdown list of subscription types. When user submit form, I show another view new_credit_card.html.haml which is in controller CreditCards. This form is submitted to SubscriptionTypes controller. Then i validate credit card information in SubscriptionTypes controller. if credit card info is not valid then i redirect to again credit cards new.html. When user select value subscription type from first form, I want to use that subscription type value in SubscriptionTypes controller. I don't know how to get that value? i used session.then I get value of subscription type, but if credit card info is not valid I get nil value when redirected to new_credit_card.html.haml? Is there another way? Thanks, Vikas. -- 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: Video sharing site.
Someone have an idea? -- 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] distributed models
Hello, I am designing a web application that has several tiers including a Flex client, Rails server and SAP back-end. The application is an extension of functionality offered by SAP system. SOAP services are used communicate with the back-end. I am pondering on the implications of the fact that some of my data models are likely to be in the back-end and some in the Rails application and some are distributed (shared) between Rails and the back-end. I would appreciate any pointers toward relevant knowledge on this subject and if anyone tried something similar with Rails. Some of the questions I have to find answers to are: - How does one use ActiveRecord with shared models? - What are the implications of this type of distributed design? - Relevant design patterns. thank you, Slava --~--~-~--~~~---~--~~ 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 do restful_authentication generated rspec tests fail
Sigh - my apologies - I replied to the wrong post... -- 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: How to delete all records in a table using a link
Colin Law wrote: I think you want something like %= link_to 'Destroy All', :action = 'destroyall', :confirm = 'Are you sure?', :method = :delete % but you might need something in routes as well, I am not sure. Colin I'll try out your suggestion. I like the setup because it has the confirmation box and post... -- 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: Dynamically connecting a model to databa ses in a running app…?
On Jun 8, 8:03 pm, gberz3 gbe...@gmail.com wrote: Hi All, I've read many of the existing questions/threads on this subject, but keep in mind that none of them have directly addressed my issue -- or they have yet to be answered. Also keep in mind that this is NOT a situation for database.yml as I won't know the DB info in advance. That said, I need a solution for DYNAMICALLY connecting to multiple databases in a Rails app. My situation is that I have multiple data logging sites, all with a simple data table (EVENTS, TIMESTAMP, VALUE). These sites need to (and will) remain as they are due to local applications that need to use them. Well you can can establish_connection pretty much whenever you want. Have you tried that ? Fred What I need is to create an application that maintains a table of MYSQL_LOGINS and uses each of those logins to connect to any one of various databases and provide charts/graphs for the data therein. My data model will remain the same for all MySQL databases to which I connect, I simply need to be able to tell my MODEL to connect to a different DB on the fly. I'm hoping this is amazingly simple, but we'll see. Best. --~--~-~--~~~---~--~~ 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 Hosting Questions
Update: I did find one review site which is pretty solid: http://www.webhostingjury.com/ It actually listed my current provider #5 which is good but I can definitely confirm that hostgator does not ruby on rails in their mindset... I'm currently talking to Lunarpages to see what type of VPS plans they have since they are listed #1 on the list. Since I'm going to go down the top 3 or 4 I'll just provide updates on what I find out to save someone else some time if they happen to read this. -- 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: Rails Hosting Questions
On Jun 8, 9:42 pm, J. D. rails-mailing-l...@andreas-s.net wrote: Hi everyone, I use Hostgator as my hosting provider and I checked out the versions of the apps they are running: Linux CentOS: 5.3 Ruby: 1.8.5 Rails: 2.3.2 MySQL: 5.1.30 I've been programming on a windows box but I do have a virtual linux box setup (not for this particular model) - I wasn't even aware that people still used Ruby 1.8.5.. My current platform for development is: Windows Vista 32 Ruby: 1.9.1-p129 Rails: 2.3.2 MySQL: 5.1.30 Do you think that there will be some problems with my development platform when it goes over to production? I'm always a fan of having a development setup that is as close as possible to the production setup. There are plenty of differences in the ruby standard library, behavior of the language and even syntax between 1.9 and 1.8 Fred What steps do you think I should take (I'm in the process of setting up a vbox for the exact specifications of my host) just in case the host setup doesn't work properly? Is there a better hosting provider than Gatorhost that will work well with Rails that houses the ability for me to setup my own environment? Thanks.. -- 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] DRY (don't repeat yourself) way / Hook to Activerecord object (to store IP address on every object created)
As part of my project, I need to store IP address for every object that was created. User Topic Payment and more... Now all these records have the following attribute in their table called ip_address_on_create. One way to do this is to put this code everywhere in the controllers: user.ip_address_on_create = request.remote_ip , and so forth. Now to conform to DRY (don't repeat yourself), I see the mechanism: after_create (model) and after_filter ( controller). I am not really sure how to tie this thing together. Would appreciate any tips or Ruby-Fu . Thanks in advance! Chris --~--~-~--~~~---~--~~ 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 Hosting Questions
J.D., You might check us out at http://railsboxcar.com/. One of our guys just did a short screencast showing off our deployment process. * http://screencast.com/t/9UoB8oYy Cheers, Robby On Mon, Jun 8, 2009 at 2:38 PM, J. D.rails-mailing-l...@andreas-s.net wrote: Update: I did find one review site which is pretty solid: http://www.webhostingjury.com/ It actually listed my current provider #5 which is good but I can definitely confirm that hostgator does not ruby on rails in their mindset... I'm currently talking to Lunarpages to see what type of VPS plans they have since they are listed #1 on the list. Since I'm going to go down the top 3 or 4 I'll just provide updates on what I find out to save someone else some time if they happen to read this. -- Posted via http://www.ruby-forum.com/. -- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting w/Ruby on Rails http://planetargon.com/ http://robbyonrails.com/ http://twitter.com/planetargon aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] --~--~-~--~~~---~--~~ 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 Hosting Questions
I have a virtual server with slicehost. They are quite good so far for what I need and keeps the cost low. I would also look at mosso, who own slicehost and offers a pay as you go version which works out cheaper. Nayeem 2009/6/8 Robby Russell ro...@planetargon.com J.D., You might check us out at http://railsboxcar.com/. One of our guys just did a short screencast showing off our deployment process. * http://screencast.com/t/9UoB8oYy Cheers, Robby On Mon, Jun 8, 2009 at 2:38 PM, J. D.rails-mailing-l...@andreas-s.net wrote: Update: I did find one review site which is pretty solid: http://www.webhostingjury.com/ It actually listed my current provider #5 which is good but I can definitely confirm that hostgator does not ruby on rails in their mindset... I'm currently talking to Lunarpages to see what type of VPS plans they have since they are listed #1 on the list. Since I'm going to go down the top 3 or 4 I'll just provide updates on what I find out to save someone else some time if they happen to read this. -- Posted via http://www.ruby-forum.com/. -- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting w/Ruby on Rails http://planetargon.com/ http://robbyonrails.com/ http://twitter.com/planetargon aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] -- cashflowclublondon.co.uk (`-''-/).___..--''`-._ `6_ 6 ) `-. ( ).`-.__.`) (_Y_.)' ._ ) `._ `. ``-..-' _..`--'_..-_/ /--'_.' ,' (il),-'' (li),' ((!.-' . --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---