[Rails] Re: Just can't get Ruby on Rails to work in Leopard
When I installed here, making rails work with mysql was painful too.. I tryed to install and re-install both the gem and mysql for about 9000 times, using several different giant terminal commands Could only make it work after installing a 32-bit version of mysql and downloading the gem using macports, which gave an error in the installation, but actually worked when I tested. On 6 abr, 03:20, Scott Corgan wrote: > I have all the latest gems, rails, and ruby installed. I keep getting > the same error, even when the re route of the mysql library. I don't > know what else to do. > > Maybe an uninstall, clean install, and fix might work? > > On Apr 5, 11:51 am, Frederick Cheung > wrote: > > > > > On Apr 5, 6:16 pm, Jferg wrote: > > > > When I moved from 2.0 to 2.1.1 I followed a similar set of steps - I > > > googled first for any hazards - the one I found was fixed by me > > > installing another gem based on error logs. Though I did not upgrade > > > MySQL yet and I don't use it in my dev environment much - yet. > > > > The one problem I saw with 2.2 was having to upgrade Ruby to 1.9 - I > > > think that is required. > > > Rails 2.2 doesn't support ruby 1.9 (rails 2.3.2 is the first version > > with ruby 1.9 support, but that ruby 1.9 is by no means compulsory) > > > Fred > > > > If you are handy with XCode you can always roll your own - Hive Logic > > > probably has build it yourself directions for everything you'd > > > need:http://hivelogic.com/articles/view/ruby-rails-leopard > > > > Hope this helps. > > > > - John > > > > On Apr 5, 3:19 am, Scott Corgan wrote: > > > > > I've tried a million different tutorials and I just can't figure this > > > > out. I have all things needed to create the development environment > > > > and I just can't get the server to function correctly I suppose. > > > > Here's the error I am getting: > > > > > "The bundled mysql.rb driver has been removed from Rails 2.2. Please > > > > install the mysql gem and try again: gem install mysql. > > > > /!\ FAILSAFE /!\ Sun Apr 05 00:17:39 -0700 2009 > > > > Status: 500 Internal Server E rror > > > > dlsym(0x1c44680, Init_mysql): symbol not found - /usr/local/lib/ruby/ > > > > gems/1.8/gems/mysql-2.7/lib/mysql.bundle" > > > > > And then when I got to localhost:3000 and click on the "About your > > > > application's environment", I get a red box that says "We're sorry, > > > > but something went wrong.We've been notified about this issue and > > > > we'll take a look at it shortly" that drops down. > > > > > I can't find a solution anywhere. > > > > > Does anyone have any suggestions? Please help! I've spent hours and I > > > > can't find anything. > > > > > Thank You! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] [REQ] archive of reverse_proxy_fix plugin (svn down since 2+ weeks)
Dears, Anyone using reverse_proxy_fix (from Brian Hogan) can provide an archive of this plugin. (update for Rails 2.3) http://www.napcsweb.com/blog/2006/05/10/reverse-proxy-fix-plugin Main repository is down since 2+ weeks. (unfortunately nobody made any mirror or clone on github) http://svn.napcsweb.com/public/reverse_proxy_fix [:-(] Thanks for your help, I really need that piece for hosting stuff under IIS ( gna! ) -- Mathieu --~--~-~--~~~---~--~~ 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 in copying file
Hi, I am facing a problem to copy the file. I am getting path of the file like this "http://photos-d.ak.fbcdn.net/photos-ak-snc1/v2574/90/75/704291251/457931_8289306.jpg";. I want to copy this file locally. I am trying to do this by using File.copy("http://photos-d.ak.fbcdn.net/photos-ak-snc1/v2574/90/75/704291251/457931_8289306.jpg","/images";); I am getting an error Invalid argument - http://photos-d.ak.fbcdn.net/photos-ak-snc1/v2574/90/75/704291251/457931_8289306.jpg I know that this is not a directory path. Is any one knows how to copy this file? Thanks Tushar -- 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] Wizard like data entry
Hello after having searched the forums I couldn't find any solution to this problem: I want to implement a multi step form across models. Step 1: Enter requested username/ password/image etc - User model Step 2: Enter Employer Job Conditions information - EmployerJobCondition model Step 3: Enter Canditate Job Conditions information - CandidateJobCondition model In the third step only I want to store all the informations. The problem is if a user is created in step 1 and then exits his browser during step 2, thus a record in the users table is dangling, no good.Any suggestion for wizard like data entry? Ive looked at the Wizard plugin (http://github.com/crankin/wizard/tree/master), however it doesnt seam like it addresses the issue mentioned above. Pls help by giving suggestions for the above mentioned problem . Thanks 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: Help to get on with jquery
HeChian wrote: > You can try this:http://ennerchi.com/projects/jrails > > On Mon, Apr 6, 2009 at 2:02 PM, Newb Newb > wrote: > >> >> > >> > > > -- > Yes! I'm HeChian :) > > http://hechian36.pixnet.net/blog Thanks for the reply Does jquery and jrails are diffrent? -- 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: Just can't get Ruby on Rails to work in Leopard
I have all the latest gems, rails, and ruby installed. I keep getting the same error, even when the re route of the mysql library. I don't know what else to do. Maybe an uninstall, clean install, and fix might work? On Apr 5, 11:51 am, Frederick Cheung wrote: > On Apr 5, 6:16 pm, Jferg wrote: > > > > > When I moved from 2.0 to 2.1.1 I followed a similar set of steps - I > > googled first for any hazards - the one I found was fixed by me > > installing another gem based on error logs. Though I did not upgrade > > MySQL yet and I don't use it in my dev environment much - yet. > > > The one problem I saw with 2.2 was having to upgrade Ruby to 1.9 - I > > think that is required. > > Rails 2.2 doesn't support ruby 1.9 (rails 2.3.2 is the first version > with ruby 1.9 support, but that ruby 1.9 is by no means compulsory) > > Fred > > > If you are handy with XCode you can always roll your own - Hive Logic > > probably has build it yourself directions for everything you'd > > need:http://hivelogic.com/articles/view/ruby-rails-leopard > > > Hope this helps. > > > - John > > > On Apr 5, 3:19 am, Scott Corgan wrote: > > > > I've tried a million different tutorials and I just can't figure this > > > out. I have all things needed to create the development environment > > > and I just can't get the server to function correctly I suppose. > > > Here's the error I am getting: > > > > "The bundled mysql.rb driver has been removed from Rails 2.2. Please > > > install the mysql gem and try again: gem install mysql. > > > /!\ FAILSAFE /!\ Sun Apr 05 00:17:39 -0700 2009 > > > Status: 500 Internal Server E rror > > > dlsym(0x1c44680, Init_mysql): symbol not found - /usr/local/lib/ruby/ > > > gems/1.8/gems/mysql-2.7/lib/mysql.bundle" > > > > And then when I got to localhost:3000 and click on the "About your > > > application's environment", I get a red box that says "We're sorry, > > > but something went wrong.We've been notified about this issue and > > > we'll take a look at it shortly" that drops down. > > > > I can't find a solution anywhere. > > > > Does anyone have any suggestions? Please help! I've spent hours and I > > > can't find anything. > > > > Thank You! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Rating Plugin dilemma !
Which rating plugin is better to use ? -- 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: Help to get on with jquery
You can try this:http://ennerchi.com/projects/jrails On Mon, Apr 6, 2009 at 2:02 PM, Newb Newb wrote: > > What version of jquery has to be used for rails 2.2.2? > any links to getting started with jquery with rails. > i have not tried any jquery still now.i want to give it a try. > pls help me to get on with jquery on rails. > > > Thanks > -- > Posted via http://www.ruby-forum.com/. > > > > -- Yes! I'm HeChian :) http://hechian36.pixnet.net/blog --~--~-~--~~~---~--~~ 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 Apply patch
I would like to use the plugin In-Place-Editing in my app.But it requires a patch to be applied as given in "http://www.yjchen.url.tw/tips/in-place-editing-for-rails-20/"; .I got the patch file and the plugin.I would like to know how can i apply patch??? Thanks 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] Help to get on with jquery
What version of jquery has to be used for rails 2.2.2? any links to getting started with jquery with rails. i have not tried any jquery still now.i want to give it a try. pls help me to get on with jquery on rails. 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] Unit test problem,
Hi, I am new in ROR. I have 4 fixtures in my '../test/fixtures' folder: user.yml, aggregationfeedmaps.yml, aggregations.yml, and feeds.yml. I have few test files in unit tests folder like user_test.rb, feeds_test.rb, aggregation_test.rb and such. When I wrote test for model 'user' using fixture user.yml it worked fine. But when I tried to run test for my other models using fixtures aggregationfeedmaps.yml, aggregations.yml, and feeds.yml it shows this error: FixtureClassNotFound: No class attached to find my test file 'feeds_test.rb': require File.dirname(__FILE__) + '/../test_helper' #class FeedsTest < ActiveSupport::TestCase class FeedsTest < Test::Unit::TestCase # Replace this with your real tests. fixtures :feeds def test_truth assert true end def test_updatefeed feed1 = feeds(:feed_1) #Feeds.updatefeed(feed1.id) #assert_equal(Time.now, feed1.lastupdate) end end my fixture file: 'feeds.yml' # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html feed_1: id: 1 sourcelink: http://sports.yahoo.com/ncaaf/teams/aad/ical.ics feeddata: testdata lastupdate: 2009-02-17 22:42:25 used: 1 feed_2: id: 2 sourcelink: http://sports.yahoo.com/ncaaf/teams/aae/ical.ics feeddata: testdata lastupdate: 2009-02-17 22:42:25 used: 2 test_truth test passes but test_updatefeed shows the FixtureClassNotFound error Any help what is going on? Any help on the topic would be highly appreciated. -- 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: general ways to create a filterable search
You are asking about some basic programming issues, so this is targeted that way. You will do well to implement session variables here. You will need to capture the user's selected options in the session and reflect those choices back to the form when the page is redrawn. You can use the same form as the original search. You can have separate session variables for each parameter or collect them in a hash. It may be easier to work with separate variables, depending on your experience. Use whatever controller you want to analyze the selected options and build or select which query to use. For those who have never done this, suppose one of the options was an integer for size. You would pass params[:option_a] or params[:search] [:option_a] to your controller. In the target action, you would set: # setting a session variable from form input; since all parameters are of the form string, # you need to convert it if you want an integer. This is done for illustrative purposes here, # as a string data type could just as well be used in the database unless you were doing some math # operation in the database. If you were passing an id, you would need # to make sure it was an integer when passed to the query session[:option_a] = params[:search][:option_a].to_i Then you would run the appropriate query such as: # using '?' makes SQL injection attacks more difficult @filter = Product.find_by_sql(["SELECT * FROM products WHERE size=?",session[:option_a]]) In the view containing the form, you would make session[:option_a] available to the appropriate input: <% size = '' unless nil == session[:option_a] size = session[:option_a].to_s # it would typically work here without the conversion method end %> > ...or the rails form_helper equivalent. This allows you to use the same form and to remember the previous input through each iteration. You will also want to be familiar with input validation techniques to handle mistakes and input from users who might try to use your site in unintended ways. You will need to use HTMLEntities for text values, even if you use an option list to submit data: def search_me # the name for the session variable and the parameter don't have to match, but it makes programming easier session[:color] => HTMLEntities.encode_entities(params[:product] [:color], :basic, :named) ...code end and in the form: <% user_text = '' unless nil == session[:color] user_text = HTMLEntities.decode_entities(session[:color]) end %> ... etc You can define searches in your model or controller (or view), but searches should be called from the controller. If you try to define a search in the model using session[:option_a], it will not work. model self.find_tea_and_crumpets(flavor) controller def breakfast find_tea_and_crumpets(session[:flavor]) This does not answer all your questions, but maybe will help someone. One of the big problems for programmers new to the MVC model is "what goes where?". There are various opinions, but much of it is up to you. As you experiment, you will need tools to expose the state of your application and what variables are being passed. To make the most of the framework, you will need to follow rails idioms as closely as possible, but it is not always possible with complex scenarios. You can view the form variables being passed in the logger and you can use session/console to test your queries. Here is a handy accessory for this type of work: http://snippets.dzone.com/posts/show/697 There is also the TextMate Footnotes plugin. Either of these may require some 'advanced' tinkering to work satisfactorily. You should also be familiar with logger.debug(). There is a RailsCast on using bindings with logger.debug - very handy. If there are any advanced programmers reading this, please feel free to offer corrections or better ideas. On Apr 4, 3:07 am, Adam Akhtar wrote: > Ive done a lot of searching on this and found lots of topics on what > search tools to use but couldnt find something re: how you generally > implement search into your project regardless of the choice of tool > (ferret etc). > > I want users to be able to do a basic search and if they want supply > some extra conditions. I return the results and the user can further > filter those results by checking boxes, entering min max values etc. The > results are filtered instantly as happens instantly via ajax like > kayak.com without reloading the page(great site for airtickets by the > way) does. Im just wondering generally how i go about this. As you will > find out I dont have the vaguest of ideas on how. > > Assuming i have a products model > > Do I create a search model with no db attached (im expecting a lot of > searches and encouraging users to use the refine function - i dont > expect saving searches to be us
[Rails] Re: How to debug a Rails application in emacs?
This is a little bit dated but the way to go is here: http://www.datanoise.com/articles/2006/7/12/tutorial-on-ruby-debug The only basic difference when running in emacs is you want to start your server (script/server) from inside a shell window like this: M-x shell $ cd your_project_root $ script/server I've used this method with ruby 1.8.7 / rails 2.2.2 and it definitely works. Unfortunately for me, I'm working with ruby 1.9.1p0 and ruby- debug hasn't quite made it there yet. Not sure what you're using for emacs but I've found aquamacs (cocoa build on emacs 22.3.1) to work quite nicely on OSX. What are you doing to get your "rails-mode" functionality? I've used rinari and am currently working with emacs-rails - both located by google. I've needed to noodle emacs-rails a bit to get it to do something reasonable with menu driven rspec variants. Let me know how it works out for you. On Apr 5, 2:56 am, Houman Dunnil wrote: > Hi folks, > > I've just installed rdebug in emacs and it works fine for ruby > scripts, but I cannot get it to work in a Rails application. Is this > doable? If so, what are the instructions for it? > > Thanks in advance, --~--~-~--~~~---~--~~ 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: CSS Background-color Weirdness
On Apr 5, 2009, at 11:38 PM, jabauer wrote: > > For some reason the stylesheet I have associated with my layout will > not change the background-color for the content retrieved from my with > <%= yield %>. To make matters stranger, I can style *any* part of the > html in my view that isn't the background-color. Has anyone had this > problem before? I have been searching for posts, but have come up > empty handed. > > Many thanks for your help. I've appended the code for the layout and > css to this post. The relevant div is "main-wrapper". > > --Jean-- > > P.S. The XHTML and CSS both validate, so I don't think that is the > problem. > > Here is the code for the layout: > ><%= yield -%> > > > #main-wrapper { > padding: 0 20px; > margin: 0 auto; > background: #ccb27f; > } Did you want to say: background-color: #ccb27f; Could you have an early tag in the template that's being yield'ed? -Rob Rob Biedenharn http://agileconsultingllc.com r...@agileconsultingllc.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] help me.... about net/http
Hai All. I have big problem in net/http.. please help me * In my application have net/http for send xml... my question => why my site only can handle one request? so only one user can request to my server.. if 2 user request... then the last user always wait or RTO I want in my application have one controller to check the other controller run or not (the xml run or not) ex: controller a --> controller which send xml controller b --> monitoring. for check the another controller... ---> i wrote net/http for request controller a (on same server)... it always will RTO why??? if other server always ok... :( Please help me Thank you very much -- Wu You Duan --~--~-~--~~~---~--~~ 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] CSS Background-color Weirdness
For some reason the stylesheet I have associated with my layout will not change the background-color for the content retrieved from my with <%= yield %>. To make matters stranger, I can style *any* part of the html in my view that isn't the background-color. Has anyone had this problem before? I have been searching for posts, but have come up empty handed. Many thanks for your help. I've appended the code for the layout and css to this post. The relevant div is "main-wrapper". --Jean-- P.S. The XHTML and CSS both validate, so I don't think that is the problem. Here is the code for the layout: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> The Early American Foreign Service Database <%= stylesheet_link_tag 'eafsd' %> Home Relation Browser Search Maps Archive Admin About <%= yield -%> Designed and Built by Jean Bauer and Powered by Project Quincy. And here is the css -- body { font-family: arial, helvetica, sans-serif; background-color: #142933; } #allcontent { width: 900px; } #header { background: #66471F; height: 150px; margin: 20px; padding-bottom: 20px; } #header img { display: block; margin: auto; } #nav { margin: 0 auto; padding: 0 20px; } #nav ul { padding: 20px 10px 20px 0px; list-style-type: none; margin: 0 auto; } #nav ul li { display: inline; } #nav ul li a { padding: 10px 20px 20px 20px; text-decoration: none; color: #CCB27F; font-weight: bold; } #nav ul li a.active { background: #CCB27F; color: #142933; } #main-wrapper { padding: 0 20px; margin: 0 auto; background: #ccb27f; } #main-wrapper h3 { color: #1B1B1B; } #content { float:right; width: 600px; margin-left:0; padding: 20px 15px; } #content img { float:right; display:inline; padding: 0 0px 20px 20px; } #sidebar { float:left; width: 200px; margin-right: 0; padding: 20px 15px; } #footer { clear:both; background: #66471F; text-align:center; padding: 10px 20px; margin: 20px; color: #CCB27F; } #footer a { color: #CCB27F; font-style:italic; } --~--~-~--~~~---~--~~ 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: Installing SQLite3 on windows
James Byrne wrote: > Arpit Gup wrote: > >> >> Please let me know what I can do ? I tried to copy sqlite3.dll file from >> web and pasted in my config folder > > Probably not a good idea. Can you confirm that you have sqllite3 itself > installed ad working? And please post the output from 'gem list' and > 'gem environment'. I did following and it worked: 1. I downloaded sqlite3 dll zip from http://www.sqlite.org/sqlitedll-3_6_12.zip and unzipped into C:\ruby\bin and then ran 2. gem install sqlite3-ruby -v 1.2.3 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: Sending email
I reckon as long as you have a SMTP server running on your local machine at port 25 you should be good to go. tashfeen.ekram wrote: > if i dont own a domain and am just interested in sending emails from > dev environment on my laptop would the config look like this: > > config.action_mailer.raise_delivery_errors = true >config.action_mailer.delivery_method = :smtp > >config.action_mailer.smtp_settings = { > :address => "localhost", > :port => 25 >} > > On Apr 5, 6:00 pm, Schalk Neethling wrote: >> Hi there, >> >> Setting that has always worked for me without fail is: >> >> config.action_mailer.raise_delivery_errors = true >>config.action_mailer.delivery_method = :smtp >> >>config.action_mailer.smtp_settings = { >> :address => "mail.yourdomain.com", >> :port => 25, >> :domain => "yourdomain.com" >>} >> >> HTH, >> Schalk >> >> tashfeen.ekram wrote: >>> sorry message got truncated. >>> i have looked around but find no solutions... >>> On Apr 5, 3:58 pm, "tashfeen.ekram" wrote: I am on ubuntu machine. i want to just do simple testing of sending emails. i first tried postfix, then mailtrap (http://rubypond.com/articles/ 2007/11/16/trap-rails-from-sending-mail-via-smtp/) to no avail. i keep getting timed out error. for postfix my settings were: config.action_mailer.smtp_settings = { :address=> 'localhost', :port => 25, :domain => 'www.example.com' } i tried changing to port 2525 to use mailtrap and got the same error. is there something essential i am missing? i just want to be able to send emails to test funcinality. not receive and nothing else. i searched around but i can not >> >> >> volume4_schalk.vcf >> < 1KViewDownload > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Schalk Neethling n:Neethling;Schalk org:Overt Strategy Consulting adr:Florauna;;Berg ave 642;Pretoria;Gauteng;0182;South Africa email;internet:sch...@overtstrategyconsulting.com title:President tel;work:+27125468436 x-mozilla-html:FALSE url:http://www.overtstrategyconsulting.com version:2.1 end:vcard
[Rails] Re: Installing SQLite3 on windows
Arpit Gup wrote: > > Please let me know what I can do ? I tried to copy sqlite3.dll file from > web and pasted in my config folder Probably not a good idea. Can you confirm that you have sqllite3 itself installed ad working? And please post the output from 'gem list' and 'gem environment'. -- 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: Sending email
if i dont own a domain and am just interested in sending emails from dev environment on my laptop would the config look like this: config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "localhost", :port => 25 } On Apr 5, 6:00 pm, Schalk Neethling wrote: > Hi there, > > Setting that has always worked for me without fail is: > > config.action_mailer.raise_delivery_errors = true > config.action_mailer.delivery_method = :smtp > > config.action_mailer.smtp_settings = { > :address => "mail.yourdomain.com", > :port => 25, > :domain => "yourdomain.com" > } > > HTH, > Schalk > > tashfeen.ekram wrote: > > sorry message got truncated. > > > i have looked around but find no solutions... > > > On Apr 5, 3:58 pm, "tashfeen.ekram" wrote: > >> I am on ubuntu machine. i want to just do simple testing of sending > >> emails. > > >> i first tried postfix, then mailtrap (http://rubypond.com/articles/ > >> 2007/11/16/trap-rails-from-sending-mail-via-smtp/) to no avail. i keep > >> getting timed out error. > > >> for postfix my settings were: > > >> config.action_mailer.smtp_settings = { > > >> :address => 'localhost', > > >> :port => 25, > > >> :domain => 'www.example.com' > > >> } > > >> i tried changing to port 2525 to use mailtrap and got the same error. > >> is there something essential i am missing? > > >> i just want to be able to send emails to test funcinality. not receive > >> and nothing else. i searched around but i can not > > > > volume4_schalk.vcf > < 1KViewDownload --~--~-~--~~~---~--~~ 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: Test: Expected response to be a <:redirect>, but was <200>
Installed debugger and re-looked at my tests. I didn't assign values for new category and for update category => therefore, the tests failed. All good now. Thanks Fred once again :) Elle On Apr 4, 8:33 pm, Frederick Cheung wrote: > On Apr 4, 4:42 am, elle wrote: > > > I have 2 tests for: test_should_create_category and > > test_should_update_category that include: > > assert_redirected_to category_path(assigns(:category)) > > But when running the test I get: > > Expected response to be a <:redirect>, but was <200> > > > The thing I don't understand is that I do get redirected -- so why is > > the test failing? > > Well for the real answer step through your code in the debugger, but > I'd guess its something like a failing validation because your test > isn't posting the right parameters. > > Fred --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] RE: OpenID relative_url_root problems
If anyone experiences the problem I described below, please see the ticket here: https://rails.lighthouseapp.com/projects/8995/tickets/34-issues-with-forgery-protection-and-rails-21-relative_url_root And apply the patch here: https://rails.lighthouseapp.com/attachments/43873/forgery_protection_and_relative_url_root.patch --- Hi there, I am trying to get OpenID authentication working and for the most part seems to have gone fine except, when authentication I keep getting: undefined method `relative_url_root' for ActionController::Base:Class I am testing from my local machine on Windows Vista using Mongrel. Any ideas why I am getting this error? Thank you in advance, Schalk --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Schalk Neethling n:Neethling;Schalk org:Overt Strategy Consulting adr:Florauna;;Berg ave 642;Pretoria;Gauteng;0182;South Africa email;internet:sch...@overtstrategyconsulting.com title:President tel;work:+27125468436 x-mozilla-html:FALSE url:http://www.overtstrategyconsulting.com version:2.1 end:vcard
[Rails] The find methods for a model class
Hi, I am doing some examples in a book on Roby on Rails. When a model class is create with generate model command, it will create some find_xxx methods on the fields. When the model have the relationships with other models, the more find_xxx methods will be generated. How do I know exactly how many and what kinds of find_xxx methods are created? Thanks. Leon --~--~-~--~~~---~--~~ 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: Setting Up Reminders
That is great. I would like to use Runt and represent the object the object in a database when i need it for future use. Any suggestions on how to represent this? There are only a finite number of things i need to be able to account for and not the full possibilities offered by the gem. On Mar 29, 10:58 pm, Philip Hallstrom wrote: > > I was hoping to get some advice on something I am trying to build. > > > I want to be able to allow users to be able to set up reminders. They > > will be allowed to choose to have reminders either once a day (or more > > than once) at particular times, reminders every other day, every > > wednsday, etc all though at specific times of the day (for example a > > reminder at 9AM every Tuesday). I would like to have some sort of > > cron job running to check what reminders need to be sent. I was hoping > > to get advice on what plugins might be useful and any othe advice on > > setting this up. still learning the ropes of rails. :) > > You might find these useful... > > http://runt.rubyforge.org/Runtis an implementation of select temporal patterns > > http://chronic.rubyforge.org/Chronicis a natural language date/time parser > written in pure Ruby. --~--~-~--~~~---~--~~ 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: conditional count mysql query.
Hi there Morgan, Something such as the following should do the trick: Article.count(:conditions => "status = 'active'") HTH, Schalk Morgan Morgan wrote: > so i have a database filled with stats and i need to return a number > from those stats for processing. how would i go about counting how many > of a certian thing there are in a particular column.. > > example: say i wanted to see how many records showed female in the users > table but i didn't actually want to pull a bunch of info, i just want > the number returned. > > thanks.. i hope this makes sense. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Schalk Neethling n:Neethling;Schalk org:Overt Strategy Consulting adr:Florauna;;Berg ave 642;Pretoria;Gauteng;0182;South Africa email;internet:sch...@overtstrategyconsulting.com title:President tel;work:+27125468436 x-mozilla-html:FALSE url:http://www.overtstrategyconsulting.com version:2.1 end:vcard
[Rails] Re: conditional count mysql query.
On 6 Apr 2009, at 00:10, Morgan Morgan wrote: > example: say i wanted to see how many records showed female in the > users > table but i didn't actually want to pull a bunch of info, i just want > the number returned. Use the count method: Person.count("gender", :conditions=>["gender=?", "female"]) There are more calculation methods available in the ActiveRecord Calculations model if you check the documentation. -Matt --~--~-~--~~~---~--~~ 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: conditional count mysql query.
isn't it just User.count(:conditions => {:sex => 'female'}) syntax may be a bit wrong, but you should be able to google to sort it out. Simon On Mon, 06 Apr 2009 07:10:11 +0800, Morgan Morgan wrote: > > so i have a database filled with stats and i need to return a number > from those stats for processing. how would i go about counting how many > of a certian thing there are in a particular column.. > > example: say i wanted to see how many records showed female in the users > table but i didn't actually want to pull a bunch of info, i just want > the number returned. > > thanks.. i hope this makes sense. --~--~-~--~~~---~--~~ 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] conditional count mysql query.
so i have a database filled with stats and i need to return a number from those stats for processing. how would i go about counting how many of a certian thing there are in a particular column.. example: say i wanted to see how many records showed female in the users table but i didn't actually want to pull a bunch of info, i just want the number returned. thanks.. i hope this makes sense. -- 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] Which Oracle connector for AR?
What DB connector do I need to talk to a network accessible Oracle server: 1) with ActiveRecord?, 2) to perform basic SQL. I'm more familiar with what it takes to get MySQL working with AR. Currently I have AR 2.1.1, Ruby 1.8.5. I'll have to ask what Oracle client/server is available. This question pertains to a RedHat 5 system which is not managed by me and is only allowed RedHat managed packages, unless I install them in my user space (/home). Rob --~--~-~--~~~---~--~~ 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 or separate packages, RedHat
So, as I introduced myself to ActiveRecord, I asked our IT department to install activerecord and this hierarchy popped up on the system: /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/ then I was able to do this irb(main):003:0> require 'rubygems' => true irb(main):004:0> require 'activerecord' => true Now I realize FasterCSV, and perhaps migrations would be handy. I'm not building a web application at the moment, rather I'm building a command line api to our DB using ActiveRecord for ORM. However perhaps one day in the future I'll be allowed a rails developed web site So, do I ask the IT department to install Ruby on Rails or continue asking for particular packages? I'd rather just get the whole thing. If so, will an install of "rails" override or interfere with already installed rails libraries? They will only install RedHat 5 managed packages without a huge fight. Other packages, I have to compile and install in my own user space (/home). This is on a RedHat RHEL 5 system (uname = 2.6.18-128.1.1.el5). Cheers and 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: Sending email
Hi there, Setting that has always worked for me without fail is: config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "mail.yourdomain.com", :port => 25, :domain => "yourdomain.com" } HTH, Schalk tashfeen.ekram wrote: > sorry message got truncated. > > i have looked around but find no solutions... > > On Apr 5, 3:58 pm, "tashfeen.ekram" wrote: >> I am on ubuntu machine. i want to just do simple testing of sending >> emails. >> >> i first tried postfix, then mailtrap (http://rubypond.com/articles/ >> 2007/11/16/trap-rails-from-sending-mail-via-smtp/) to no avail. i keep >> getting timed out error. >> >> for postfix my settings were: >> >> config.action_mailer.smtp_settings = { >> >> :address=> 'localhost', >> >> :port => 25, >> >> :domain => 'www.example.com' >> >> } >> >> i tried changing to port 2525 to use mailtrap and got the same error. >> is there something essential i am missing? >> >> i just want to be able to send emails to test funcinality. not receive >> and nothing else. i searched around but i can not > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Schalk Neethling n:Neethling;Schalk org:Overt Strategy Consulting adr:Florauna;;Berg ave 642;Pretoria;Gauteng;0182;South Africa email;internet:sch...@overtstrategyconsulting.com title:President tel;work:+27125468436 x-mozilla-html:FALSE url:http://www.overtstrategyconsulting.com version:2.1 end:vcard
[Rails] OpenID relative_url_root problems
Hi there, I am trying to get OpenID authentication working and for the most part seems to have gone fine except, when authentication I keep getting: undefined method `relative_url_root' for ActionController::Base:Class I am testing from my local machine on Windows Vista using Mongrel. Any ideas why I am getting this error? Thank you in advance, Schalk --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- begin:vcard fn:Schalk Neethling n:Neethling;Schalk org:Overt Strategy Consulting adr:Florauna;;Berg ave 642;Pretoria;Gauteng;0182;South Africa email;internet:sch...@overtstrategyconsulting.com title:President tel;work:+27125468436 x-mozilla-html:FALSE url:http://www.overtstrategyconsulting.com version:2.1 end:vcard
[Rails] Re: Sending email
sorry message got truncated. i have looked around but find no solutions... On Apr 5, 3:58 pm, "tashfeen.ekram" wrote: > I am on ubuntu machine. i want to just do simple testing of sending > emails. > > i first tried postfix, then mailtrap (http://rubypond.com/articles/ > 2007/11/16/trap-rails-from-sending-mail-via-smtp/) to no avail. i keep > getting timed out error. > > for postfix my settings were: > > config.action_mailer.smtp_settings = { > > :address => 'localhost', > > :port => 25, > > :domain => 'www.example.com' > > } > > i tried changing to port 2525 to use mailtrap and got the same error. > is there something essential i am missing? > > i just want to be able to send emails to test funcinality. not receive > and nothing else. i searched around but i can not --~--~-~--~~~---~--~~ 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] Sending email
I am on ubuntu machine. i want to just do simple testing of sending emails. i first tried postfix, then mailtrap (http://rubypond.com/articles/ 2007/11/16/trap-rails-from-sending-mail-via-smtp/) to no avail. i keep getting timed out error. for postfix my settings were: config.action_mailer.smtp_settings = { :address=> 'localhost', :port => 25, :domain => 'www.example.com' } i tried changing to port 2525 to use mailtrap and got the same error. is there something essential i am missing? i just want to be able to send emails to test funcinality. not receive and nothing else. i searched around but i can not --~--~-~--~~~---~--~~ 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: Just can't get Ruby on Rails to work in Leopard
On Apr 5, 6:16 pm, Jferg wrote: > > When I moved from 2.0 to 2.1.1 I followed a similar set of steps - I > googled first for any hazards - the one I found was fixed by me > installing another gem based on error logs. Though I did not upgrade > MySQL yet and I don't use it in my dev environment much - yet. > > The one problem I saw with 2.2 was having to upgrade Ruby to 1.9 - I > think that is required. > Rails 2.2 doesn't support ruby 1.9 (rails 2.3.2 is the first version with ruby 1.9 support, but that ruby 1.9 is by no means compulsory) Fred > If you are handy with XCode you can always roll your own - Hive Logic > probably has build it yourself directions for everything you'd > need:http://hivelogic.com/articles/view/ruby-rails-leopard > > Hope this helps. > > - John > > On Apr 5, 3:19 am, Scott Corgan wrote: > > > I've tried a million different tutorials and I just can't figure this > > out. I have all things needed to create the development environment > > and I just can't get the server to function correctly I suppose. > > Here's the error I am getting: > > > "The bundled mysql.rb driver has been removed from Rails 2.2. Please > > install the mysql gem and try again: gem install mysql. > > /!\ FAILSAFE /!\ Sun Apr 05 00:17:39 -0700 2009 > > Status: 500 Internal Server E rror > > dlsym(0x1c44680, Init_mysql): symbol not found - /usr/local/lib/ruby/ > > gems/1.8/gems/mysql-2.7/lib/mysql.bundle" > > > And then when I got to localhost:3000 and click on the "About your > > application's environment", I get a red box that says "We're sorry, > > but something went wrong.We've been notified about this issue and > > we'll take a look at it shortly" that drops down. > > > I can't find a solution anywhere. > > > Does anyone have any suggestions? Please help! I've spent hours and I > > can't find anything. > > > Thank You! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: How to debug a Rails application in emacs?
Houman Dunnil wrote: > Hi folks, > > I've just installed rdebug in emacs and it works fine for ruby > scripts, but I cannot get it to work in a Rails application. Is this > doable? If so, what are the instructions for it? > > Thanks in advance, Although the real guru's here may correct this, I'm doubting you're going to be able to do it in emacs. The debugger works through the console that is used to start the test server. It's enabled by using the --debugger (or -u) option: ruby script/server --debugger The debug output and control will then be seen on the console where you started the server. -- 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: auto_increment question???
kingduggan wrote: > Hello All, > > So I am new to rails and the first project I am creating is a > ticketing system to log customer support. All I am trying to do is > have the primary id of each new ticket auto increment like ticket id > 1001, 1002, 1003, ect. and display the ticket id in the show tickets. > > I am confused because I'm not sure if this would be created doing a > migration or in the model tickets after the migration has been done?? > > Any help would be great. Unless I'm not understanding the question, you already have this. With ActiveRecord, (by default) every record has an id that will be unique. You don't have to do anything to get it. While you can override it, every table has a field named 'id'. This will be incremented and maintained by the system. In MySQL it will be an 'auto_increment' field and defined as the primary key. ---Michael -- 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: Error reverting back to a previous version of rails
On Sun, Apr 5, 2009 at 3:13 AM, Stephen Fagan wrote: > >> I want to revert back to a previous version of rails (1.2.3) but the >> project I want to work on was created in 2.0.2. >> c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:328:in >> `send': undefined method `session=' for ActionController::Base:Class >> (NoMethodError) > I have narrowed it down to this piece of code in config\environment.rb: > If I comment this out the server boots no problem but I get an error > when I open up localhost:3000 in the browser. Has nyone a sloution 1) drop the idea of moving backwards -- I mean WTF? Why? :-) 2) look at the difference between 1.2.3 and 2.0.2 ActionController code and add the functionality missing in 1.2.3 3) #2 could also be done by running your tests and doing whatever necessary to make them pass. FWIW, -- 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: problem with visual scriptaculous puff
Thanks a lot Jaryl. that did 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] Re: Use a value from a different model
Hi, no crappy data. I really think i have a normalization issue :( I'll try to change everything and see how it goes. thanks 8 P. On 5 avr, 19:08, Frederick Cheung wrote: > On Apr 5, 5:55 pm, P wrote: > > > Hi, > > thanks hassan for the quick reply. > > I applied your suggestions + had to change a few other things (folder > > name for the views, some routes...) but that didn't help either :( > > it should also be belongs_to :purchase_type rather than purchaseType > but I don't think that will actually make a difference (and if you > made that change you would have to rename the column to > purchase_type_id). > Have you checked that you don't simply have bad data in your database > (ie a saving with a purchaseType_id for which there is no > corresponding PurchaseType ? > > Fred > > > any other idea? > > > thanks > > P. > > > On 5 avr, 18:46, Hassan Schroeder wrote: > > > > On Sun, Apr 5, 2009 at 8:46 AM, P wrote: > > > > the controller (saving_controller): > > > > > class SavingController < ApplicationController > > > > s/b SavingsController > > > > > class PurchaseType < ActiveRecord::Base > > > > has_many :saving > > > > s/b has_many :savings > > > > Try changing that and let us know what happens :-) > > > > -- > > > 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: Just can't get Ruby on Rails to work in Leopard
Assuming your only issue is MySQL Support on OS X Leopard, did you happen to note this blog? http://blog.flinter.com/2009/01/16/installing-rails-22-on-osx-leopard/ I assume when you first got your Leopard install it was pre-Rails 2.0? I followed these instructions and simply installed MySQL for OS X from the MYSQL install directions and had no issues: http://developer.apple.com/tools/developonrailsleopard.html When I moved from 2.0 to 2.1.1 I followed a similar set of steps - I googled first for any hazards - the one I found was fixed by me installing another gem based on error logs. Though I did not upgrade MySQL yet and I don't use it in my dev environment much - yet. The one problem I saw with 2.2 was having to upgrade Ruby to 1.9 - I think that is required. If you are handy with XCode you can always roll your own - Hive Logic probably has build it yourself directions for everything you'd need: http://hivelogic.com/articles/view/ruby-rails-leopard Hope this helps. - John On Apr 5, 3:19 am, Scott Corgan wrote: > I've tried a million different tutorials and I just can't figure this > out. I have all things needed to create the development environment > and I just can't get the server to function correctly I suppose. > Here's the error I am getting: > > "The bundled mysql.rb driver has been removed from Rails 2.2. Please > install the mysql gem and try again: gem install mysql. > /!\ FAILSAFE /!\ Sun Apr 05 00:17:39 -0700 2009 > Status: 500 Internal Server E rror > dlsym(0x1c44680, Init_mysql): symbol not found - /usr/local/lib/ruby/ > gems/1.8/gems/mysql-2.7/lib/mysql.bundle" > > And then when I got to localhost:3000 and click on the "About your > application's environment", I get a red box that says "We're sorry, > but something went wrong.We've been notified about this issue and > we'll take a look at it shortly" that drops down. > > I can't find a solution anywhere. > > Does anyone have any suggestions? Please help! I've spent hours and I > can't find anything. > > Thank You! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Easy way to convert URL back to route name?
Alternatively, you can just use the current_page? method: if current_page? foo_url #do some ish elsif current_page? bar_url # other stuff... On Apr 4, 12:27 am, Dave Cantrell wrote: > Hi all, > > I'm looking for a way to do the reverse of what the named route helpers > do. Namely: > > Given routes: > > map.foo '/foo/:id', :controller => 'foo', :action => 'show' > map.bar '/bar/:id', :controller => 'bar', :action => 'show' > > Given urls: > > /foo/1 > /bar/1 > > I'd like to be able to do something like this in my layout: > > if requested_foo_path > # ... show something specific to foo > elsif requested_bar_path > # ... show something specific to bar > end > > There's probably a better way to do this, but I'm new to rails so any > help appreciated. > > 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: Use a value from a different model
On Apr 5, 5:55 pm, P wrote: > Hi, > thanks hassan for the quick reply. > I applied your suggestions + had to change a few other things (folder > name for the views, some routes...) but that didn't help either :( > it should also be belongs_to :purchase_type rather than purchaseType but I don't think that will actually make a difference (and if you made that change you would have to rename the column to purchase_type_id). Have you checked that you don't simply have bad data in your database (ie a saving with a purchaseType_id for which there is no corresponding PurchaseType ? Fred > any other idea? > > thanks > P. > > On 5 avr, 18:46, Hassan Schroeder wrote: > > > On Sun, Apr 5, 2009 at 8:46 AM, P wrote: > > > the controller (saving_controller): > > > > class SavingController < ApplicationController > > > s/b SavingsController > > > > class PurchaseType < ActiveRecord::Base > > > has_many :saving > > > s/b has_many :savings > > > Try changing that and let us know what happens :-) > > > -- > > 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: Use a value from a different model
Hi, thanks hassan for the quick reply. I applied your suggestions + had to change a few other things (folder name for the views, some routes...) but that didn't help either :( any other idea? thanks P. On 5 avr, 18:46, Hassan Schroeder wrote: > On Sun, Apr 5, 2009 at 8:46 AM, P wrote: > > the controller (saving_controller): > > > class SavingController < ApplicationController > > s/b SavingsController > > > class PurchaseType < ActiveRecord::Base > > has_many :saving > > s/b has_many :savings > > Try changing that and let us know what happens :-) > > -- > 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: Use a value from a different model
On Sun, Apr 5, 2009 at 8:46 AM, P wrote: > the controller (saving_controller): > > class SavingController < ApplicationController s/b SavingsController > class PurchaseType < ActiveRecord::Base > has_many :saving s/b has_many :savings Try changing that and let us know what happens :-) -- 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: Disable routing?
On Apr 5, 4:37 pm, Chris Benson wrote: > Thanks Fred, but it's a shared hosting environment, and I don't have > access to anything outside my /home area. > That's not necessarily a problem. For example if you were using apache the a .htaccess in the DocumentRoot of your website can do things like that. > I'm looking for a way to tell Rails routing, "Ignore these two > directories." > I'm pretty sure that by the time Rails has got the request it's too late - rails isn't going to load php to execute your wordpress app for example.d? Fred --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Use a value from a different model
Hello, I cannot find the issue and it drives me crazy :( let's simplify. I have 2 models: saving and purchase_type a *saving* corresponds to a *purchase_type* e.g. new sourcing or renegotiation a saving has exactly one purchase_type and a purchase_type has many savings. when I try to display the list of savings and their purchase type (name, not Id), i get the dreaded "You have a nil object when you didn't expect it!". The weirdest thing is that it works for category and subcategory, but not for purchase type. Is this a camel casing issue? All the relevant code is below I'm getting mad, please help :) Thanks, P. Here's the index.rhtml (extracts -- RoR tells me the issue is on the line with *): <% @saving.each do |s|%> <%=s.id%> <%=s.country.name%> <%=s.country_reference%> <%=s.supplier%> <%=s.buyer%> <%=s.category.name%> <%=s.subcategory.name%> * <%=s.purchaseType.name %> the controller (saving_controller): class SavingController < ApplicationController def index @category = Category.find(:all).collect {|c| [ c.name, c.id ] } @subcategory = Subcategory.find(:all).collect {|c| [ c.name, c.id ] } @purchaseType = PurchaseType.find(:all).collect {|c| [ c.name, c.id ] } sort_order = params[:sort_by] sort_order ||= 'id' # for default sort @saving = Saving.search(params[:search], params[:page], sort_order) end end the saving model (saving - table name = savings): class Saving < ActiveRecord::Base validates_presence_of :supplier, :a_saving, :a_spend, :country_id, :category_id, :subcategory_id, :buyer, :purchaseType_id, validates_numericality_of :a_saving, :a_spend belongs_to :category belongs_to :purchaseType belongs_to :subcategory def self.search(search, page, sort_order) search='%' if search=='' || search=='Type your search term' paginate:page => page, :conditions => ['supplier like ?',"%#{search}%"], :order => sort_order end end the purchase_type model (model name = PurchaseType -table name = purchase_types): class PurchaseType < ActiveRecord::Base validates_presence_of :name has_many :saving 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] auto_increment question???
Hello All, So I am new to rails and the first project I am creating is a ticketing system to log customer support. All I am trying to do is have the primary id of each new ticket auto increment like ticket id 1001, 1002, 1003, ect. and display the ticket id in the show tickets. I am confused because I'm not sure if this would be created doing a migration or in the model tickets after the migration has been done?? Any help would be great. Thanks, Duggan --~--~-~--~~~---~--~~ 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] Partial-Form validation from multiple pages (f.e. login-partial)
Hello - hard question: I have my login-partial in my application.html.erb-layout. Now I want to validate it, if the user pushes the submit button and show error-messages for it, if e.g. the passwordfield is empty. But how do I do that? For getting the error messages, I must use render :action => 'create' But there I have to know, from which action I came from. Beside different pages, need different seperate instance variables (which arn't reproduced with render :action). Second try with redirect_to :back looses the errors-array...! How can I solve this problem? Found nothing in the net =( Beside: I'm using restful_authentication-plugin HEEELP! --~--~-~--~~~---~--~~ 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: Disable routing?
Thanks Fred, but it's a shared hosting environment, and I don't have access to anything outside my /home area. I'm looking for a way to tell Rails routing, "Ignore these two directories." On Apr 5, 7:07 am, Frederick Cheung wrote: > On Apr 5, 8:03 am, Chris Benson wrote:> I have a > Rails application that a couple of folders in the root (of > > public) for Wordpress and Mediawiki that I want to completely exclude > > from Rails routing. How do I have the routing function of my Rails > > app ignore anything in the /blog or /wiki directories? > > > Example: > > > When someone types inhttp://mydomain.com/blog, I want the Rails app's > > routing to ignore it. > > Typically you don't do this inside rails, you do this in apache, nginx > etc. by telling it to only proxy through to rails what you want to > through (so normally you would let nginx or apache handle static > files) > > Fred > > > Thanks, > > 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: Just can't get Ruby on Rails to work in Leopard
On Apr 5, 3:23 pm, Scott Corgan wrote: > I mean I've tried re installing. I've tried installing with MacPorts. > I just keep getting the same error no matter what. Do you know of any > sites that can just walk me through step by step on how to get this > working in Leopard besides the Hivelogic article. That doesn't work > for me. I'm kinda new at Rails so I dunno how I can be more specific. > Well to me, specific means (for example) exactly how you installed the mysql gem, how you installed mysql etc. Fred > On Apr 5, 4:00 am, Frederick Cheung > wrote: > > > On Apr 5, 8:19 am, Scott Corgan wrote: > > > > I can't find a solution anywhere. > > > > Does anyone have any suggestions? Please help! I've spent hours and I > > > can't find anything. > > > Really hard to be helpful if we don't know what you've tried :-) > > (Other than to say that your mysql gem is screwed) > > > Fred --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Just can't get Ruby on Rails to work in Leopard
I mean I've tried re installing. I've tried installing with MacPorts. I just keep getting the same error no matter what. Do you know of any sites that can just walk me through step by step on how to get this working in Leopard besides the Hivelogic article. That doesn't work for me. I'm kinda new at Rails so I dunno how I can be more specific. On Apr 5, 4:00 am, Frederick Cheung wrote: > On Apr 5, 8:19 am, Scott Corgan wrote: > > > I can't find a solution anywhere. > > > Does anyone have any suggestions? Please help! I've spent hours and I > > can't find anything. > > Really hard to be helpful if we don't know what you've tried :-) > (Other than to say that your mysql gem is screwed) > > Fred --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Where to store scrape results?
Excellent thanks once again Andrew! Appreciate your advice. -- 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: Where to store scrape results?
On Sun, Apr 5, 2009 at 12:17 PM, Adam Akhtar wrote: > > Thanks Andrew for ruling out any doubts i had regarding using yaml. > > I will cache the reuslts then for around 2 hours in a db. > > Im now wondering how this will affect the performance of filtering. > > My guess is that when a user selects some filters on the results screen, > these get passed as params back to the controllers index. Logic there > will determine its a request to filter existing results and will access > the cache in the db and grab the yaml. Then use yaml to turn the info > into the relevant objects and then use enumerators find_all method to > filter the results... > > do you think that approach is ok or is there a better way of doing it? > > many thanks once again. you have been a great help. > > > > -- > Posted via http://www.ruby-forum.com/. > > > > Sounds good to me. I always focus on getting the job done in the simplest way possible first. Then work on optimisation if you see a bottleneck. Your biggest problem is likely to be fetching all the other sites for scraping which caching will hopefully help with. Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --~--~-~--~~~---~--~~ 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: Installing SQLite3 on windows
I got the same error as James and then I tried to run >> gem uninstall sqlite-ruby >> ... >> gem install sqlite3-ruby as per your suggestions, but I get following error: C:\Documents and Settings\Arpit\Desktop\Denali\denali>gem uninstall sqlite-ruby ERROR: While executing gem ... (Gem::InstallError) Unknown gem sqlite-ruby >= 0 C:\Documents and Settings\Arpit\Desktop\Denali\denali> C:\Documents and Settings\Arpit\Desktop\Denali\denali>gem install sqlite3-ruby Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. c:/ruby/bin/ruby.exe extconf.rb install sqlite3-ruby checking for fdatasync() in rt.lib... no checking for sqlite3.h... no nmake 'nmake' is not recognized as an internal or external command, operable program or batch file. Gem files will remain installed in c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1 .2.4 for inspection. Results logged to c:/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_ api/gem_make.out Please let me know what I can do ? I tried to copy sqlite3.dll file from web and pasted in my config folder Thanks in advance. Matt Gregory wrote: > James Byrne wrote: > >> gem uninstall sqlite-ruby >> ... >> gem install sqlite3-ruby > > Thank you! That was very helpful. -- 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] How to debug a Rails application in emacs?
Hi folks, I've just installed rdebug in emacs and it works fine for ruby scripts, but I cannot get it to work in a Rails application. Is this doable? If so, what are the instructions for it? Thanks in advance, --~--~-~--~~~---~--~~ 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 and Firefox on crack with redirections
This could be handy: <% req = request.env req.each do |key,value| %> <%= "#{key}" %><%= "#{value}" %> <% end %> On Apr 4, 1:01 pm, Fernando Perez wrote: > > Without going into the specifics of what you have or have not done, I > > think you might need to do a little more digging: is firefox > > requesting the wrong page from your app, is it requesting the right > > page but doing something funny, is it just serving a page from its > > cache ? > > > Fred > > Firefox requests the page that was protected by the before_filter. > Safari doesn't do that. > > It's only when I use the refresh button (or ctrl+r shortcut) that > firefox instead of refreshing the current index page, goes to the former > /show/my_url. > > If I "refresh" manually the index page by simply pressing the Enter key > when focus is in the address bar, it doesn't act stupidly. > -- > 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: A problem with my cucumber
Gavin wrote: > Recently installed the cucumber gem. > > Followed the steps as shown on Railscasts - > http://railscasts.com/episodes/155-beginning-with-cucumber > > "script/generate cucumber" works fine but when I try to run "cucumber > features -n" I get an error: > > -bash: cucumber: command not found Cuke is teetering on the brink of this forum demanding it get its own forum: news://news.gmane.org:119/gmane.comp.lang.ruby.rspec.user Try more advanced cucumber questions there. Until then, your RubyGems binary folder is not on your path - El Goog will tell you what that folder is. Something like /var/lib/gems/1.9.0/bin , but I can't find you my own example because Debian's Ruby packages blow goats. --~--~-~--~~~---~--~~ 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] [ANN] assert{ 2.0 } 0.4.8 unit-tests Ajax using assert_rjs syntax + assert_xhtml
Railsters: assert{ 2.0 } now contains "alpha" replacements for these assertions from the "arts" project: assert_rjs_ :alert, 'This is an alert' assert_rjs_ :call, 'foo', 'bar', /baz/ # matches foo("bar", "baz") assert_rjs_ :remove, 'offending_div' assert_rjs_ :replace, 'person_45', 'This replaces person_45' assert_rjs_ :replace_html, :label_7, /Top_Ranking/ Notice these assertions are not yet drop-in compatible with assert_rjs classic - hence the trailing _. More replacements are naturally forthcoming. The improvement is they use racc and rkelly, which form a real JavaScript lexer. This solution is much better than Regexp (and better than certain lexers I have tried in the past!). The assertion is more accurate, so it can use both Regexp and assert_xhtml to pin down each important detail of generated JavaScript. One common Ajax scenario revolves around sending Element.update() commands containing the output of View partials. These can be very complex, so testing them _before_ they get into a real web browser can be mission-critical. The following test intercepts an Element.update("staff_access", "..."), where the "..." contains an entire . (Not my idea, but you must admit it gets the job done!) Everything inside the do...end blocks is assert_xhtml notation ( described here: http://assert2.rubyforge.org/svn/README ). The assert_rjs_ intercepted the "..." payload, interpreted it, and rendered it as HTML. This allows us to test that secret payload just as freely as we would have tested HTML after a simple GET: def test_deleting_a_staff_sets_active_flag_to_false_instead_of_destroying_it aaron = staff(:aaron) xhr :post, :xhr_delete_staff, :staff_id => aaron.id assert_rjs_ :replace_html, :staff_list, /quentin/ do form :name => :staff_access, :verbose! => true do without!{ tr :id => "staff_#{ aaron.id }" } end end assert{ Staff.find_by_id(aaron.id).active? == false } end The test shows :verbose! => true - use it to get a glimpse of your actual HTML partial, without all the JavaScript delimiters cluttering it up. The test also shows without!{} testing that aaron did indeed disappear from the form. Both :replace and :replace_html use this syntax. If anyone needs any other "arts" assertion here - or even a new kind of JS assertion - ping me and I will add it. Get assert_rjs_ with: gem install racc rkelly nokogiri assert2 require 'assert2/rjs' (Note that assert2 contains more than one reusable module, so it does not automatically require every dependency. This lets you only install the gems you need...) -- Phlip --~--~-~--~~~---~--~~ 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] A problem with my cucumber
Hi all - Recently installed the cucumber gem. Followed the steps as shown on Railscasts - http://railscasts.com/episodes/155-beginning-with-cucumber "script/generate cucumber" works fine but when I try to run "cucumber features -n" I get an error: -bash: cucumber: command not found any clues? --~--~-~--~~~---~--~~ 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: Disable routing?
On Apr 5, 8:03 am, Chris Benson wrote: > I have a Rails application that a couple of folders in the root (of > public) for Wordpress and Mediawiki that I want to completely exclude > from Rails routing. How do I have the routing function of my Rails > app ignore anything in the /blog or /wiki directories? > > Example: > > When someone types inhttp://mydomain.com/blog, I want the Rails app's > routing to ignore it. > Typically you don't do this inside rails, you do this in apache, nginx etc. by telling it to only proxy through to rails what you want to through (so normally you would let nginx or apache handle static files) Fred > Thanks, > 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: Just can't get Ruby on Rails to work in Leopard
On Apr 5, 8:19 am, Scott Corgan wrote: > I can't find a solution anywhere. > > Does anyone have any suggestions? Please help! I've spent hours and I > can't find anything. > Really hard to be helpful if we don't know what you've tried :-) (Other than to say that your mysql gem is screwed) Fred --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: problem with visual scriptaculous puff
You might be specifying the :update hash value in your link_to_remote (or other JS helper). If you remove it, it should work. On Apr 5, 1:52 pm, Tam Kbe wrote: > Hello, > > I'm trying to using the puff effect of Scriptaculous in part of my > website. > > I have it working in some part of my website as follows: > respond_to do |wants| > wants.html do > flash[:notice] = 'client successfully removed from list.' > end > wants.js { render(:update){|page| page.visual_effect :puff, > "edit_single_client_di...@client.id}".to_sym}} > end > end > > Which works fine. If I put is some other part of website I got this > 'puffing' instead of the real content of the DIV I'm trying to "puff" as > a result (this is excerpt instead of the real thing): > > try { > $("recipient_list_div").update("\n\n\t\n\n\t\n\t\n\n\t\t\u003Ctable > \u003E\n\t\t\t\u003Ctr\u003E\n\t \n\t\t\t\t\t\n\t\t\t \n\t\t\t \n\t\t\t > \t\t\t\t\t\t\t\t\t\n\t\t\t\t\u003Ctd nowrap=\"nowrap\" width=\"95\" > height=\"10\"\u003E\n\t\t\t\t \u003Cdiv > id=\"recipient_client_1\"\u003E\n\t\t\t\t\t\t\u003Cdiv\u003E\n \u003Cb > class=\"spiffy\"\u003E\n \u003Cb > class=\"spiffy1\"\u003E\u003Cb\u003E\u003C/b\u003E\u003C/b\u003E\n > \u003Cb > class=\"spiffy2\"\u003E\u003Cb\u003E\u003C/b\u003E\u003C/b\u003E\n > \u003Cb class=\"spiffy3\"\u003E\u003C/b\u003E\n \u003Cb > class=\"spiffy4\"\u003E\u003C/b\u003E\n \u003Cb > class=\"spiffy5\"\u003E\u003C/b\u003E\u003C/b\u003E\n \u003Cdiv > class=\"spiffyfg\"\u003E\n\t\t\u003Ctable > width=\"100%\"\u003E\n\t\t\t\u003Ctr\u003E\n\t\t\t\t\u003Ctd > width=\"97%\" align=\"left\" \u003E\n\t\t\t\t\t\u003Cdiv > class=\"recipient_list_style\"\u003E\n\t\t\t\t\t\t\n\t\t\t\t\t\tTammam > Kbeili\t\t\t\t\t\n\t\t\t\t\t\u003C/div\u003E\n\t\t\t\t\u003C/td\u003E\n\t\t > \t\t\u003Ctd > width=\"3%\" align=\"right\"\u003E\n\t\t\t\t\t\u003Cimg > alt=\"Ajax-loader-green\" height=\"15\" > id=\"add_icon_ajax_indicator_recip1\" > src=\"/images/ajax-loader-green.gif?1238481847\" style=\"display:none\" > width=\"15\" /\u003E \t\t\t\t\t\n\t\t\t\t \u003Ca href=\"#\" > onclick=\"new Ajax.Updater('recipients_list_div', > '/sms/remove_client_to_recipients_list?client_id=1\u0026amp;recipient_sessi > on_id=recipients_list', > {asynchronous:true, evalScripts:true, > onLoading:function(request){$('add_icon_ajax_indicator_recip1').show();$('r > emove_client_icon_recip1').hide();}}); > return false;\"\u003E\u003Cimg alt=\"Remove_icon_recip\" border=\"0\" > height=\"15\" id=\"remove_client_icon_recip1\" > src=\"/images/remove_icon_recip.png?1238564525\" title=\"remove > user:Tammam Kbeili from recipients list\" width=\"15\" > /\u003E\u003C/a\u003E\t\t\t\t\t\t\n\t\t\t\t\u003C/td\u003E\n\t\t\t\u003C/tr > \u003E\n\t\t\u003C/table\u003E\n > \u003C/div\u003E\n\n \u003Cb class=\"spiffy\"\u003E\n \u003Cb > class=\"spiffy5\"\u003E\u003C/b\u003E\n \u003Cb > class=\"spiffy4\"\u003E\u003C/b\u003E\n \u003Cb > class=\"spiffy3\"\u003E\u003C/b\u003E\n \u003Cb > class=\"spiffy2\"\u003E\u003Cb\u003E\u003C/b\u003E\u003C/b\u003E\n > \u003Cb > class=\"spiffy1\"\u003E\u003Cb\u003E\u003C/b\u003E\u003C/b\u003E\u003C/b\u0 > 03E\n\u003C/div\u003E\n\n\n\t\n\n\t\t\t\t\t > \t\n\t\t\t\t \u003C/div\u003E\n\t\t > \t\t\u003C/td\u003E\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t \n\t\t\t > \n\t\t\t \t\t\t\t\t\t\t\t\t\n\t\t\t\t\u003Ctd nowrap=\"nowrap\" > width=\"95\" height=\"10\"\u003E\n\t\t\t\t \u003Cdiv > id=\"recipient_client_35\"\u003E\n\t\t\t\t\t\t\u003Cdiv\u003E\n \u003Cb > class=\"spiffy\"\u003E\n \u003Cb > class=\"spiffy1\"\u003E\u003Cb\u003E\u003C/b\u003E\u003C > > Not sure what this is happening. I'm guessing it might be interfering > with something I have on that page such as style or script. > I also tried this in different formats > > Is there any such known issue with Scriptaculous and rails? > > Thanks, > > Tam > -- > Posted viahttp://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] New Relic & RightScale - Ruby on Rails Life Cycle Tools
Cloud Computing and Rails are a natural good fit. With tools provided by New Relic integrated into the RightScale Deployment and Monitoring platform you have a Best Practice Monitoring system. I Deploy and Watch servers all day as part of the http://myCloudWatcher.com service. When I started to build the demo for this next RightScale Webinar I learned more about my application in the first few hours with the tools then I had ever seen before. Please come join me at the Webinar and learn how you can instrument you next Deployment and provide top quality service with your next project. The Webinar will be live: What: Live Webinar When: Thursday, April 9, 2009 at 11 am PT / 2 pm ET Who: RightScale & Steve Hudson, Director at New Relic Or you can watch the movie later on the RightScale WebSite: http://www.rightscale.com/news_events/webinars.php The New Relic Tools Web Page: http://newrelic.com/index.html Edward M. Goldberg e.m.g. http://Blog.EdwardMGoldberg.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] Just can't get Ruby on Rails to work in Leopard
I've tried a million different tutorials and I just can't figure this out. I have all things needed to create the development environment and I just can't get the server to function correctly I suppose. Here's the error I am getting: "The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql. /!\ FAILSAFE /!\ Sun Apr 05 00:17:39 -0700 2009 Status: 500 Internal Server E rror dlsym(0x1c44680, Init_mysql): symbol not found - /usr/local/lib/ruby/ gems/1.8/gems/mysql-2.7/lib/mysql.bundle" And then when I got to localhost:3000 and click on the "About your application's environment", I get a red box that says "We're sorry, but something went wrong.We've been notified about this issue and we'll take a look at it shortly" that drops down. I can't find a solution anywhere. Does anyone have any suggestions? Please help! I've spent hours and I can't find anything. Thank You! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Disable routing?
I have a Rails application that a couple of folders in the root (of public) for Wordpress and Mediawiki that I want to completely exclude from Rails routing. How do I have the routing function of my Rails app ignore anything in the /blog or /wiki directories? Example: When someone types in http://mydomain.com/blog, I want the Rails app's routing to ignore it. Thanks, 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: problem with visual scriptaculous puff
I don't know why my last message didn't get through. You can try not setting the :update option in your link_to_remote or whatever Prototype helper you are calling. On Apr 5, 1:52 pm, Tam Kbe wrote: > Hello, > > I'm trying to using the puff effect of Scriptaculous in part of my > website. > > I have it working in some part of my website as follows: > respond_to do |wants| > wants.html do > flash[:notice] = 'client successfully removed from list.' > end > wants.js { render(:update){|page| page.visual_effect :puff, > "edit_single_client_di...@client.id}".to_sym}} > end > end > > Which works fine. If I put is some other part of website I got this > 'puffing' instead of the real content of the DIV I'm trying to "puff" as > a result (this is excerpt instead of the real thing): > > try { > $("recipient_list_div").update("\n\n\t\n\n\t\n\t\n\n\t\t\u003Ctable > \u003E\n\t\t\t\u003Ctr\u003E\n\t \n\t\t\t\t\t\n\t\t\t \n\t\t\t \n\t\t\t > \t\t\t\t\t\t\t\t\t\n\t\t\t\t\u003Ctd nowrap=\"nowrap\" width=\"95\" > height=\"10\"\u003E\n\t\t\t\t \u003Cdiv > id=\"recipient_client_1\"\u003E\n\t\t\t\t\t\t\u003Cdiv\u003E\n \u003Cb > class=\"spiffy\"\u003E\n \u003Cb > class=\"spiffy1\"\u003E\u003Cb\u003E\u003C/b\u003E\u003C/b\u003E\n > \u003Cb > class=\"spiffy2\"\u003E\u003Cb\u003E\u003C/b\u003E\u003C/b\u003E\n > \u003Cb class=\"spiffy3\"\u003E\u003C/b\u003E\n \u003Cb > class=\"spiffy4\"\u003E\u003C/b\u003E\n \u003Cb > class=\"spiffy5\"\u003E\u003C/b\u003E\u003C/b\u003E\n \u003Cdiv > class=\"spiffyfg\"\u003E\n\t\t\u003Ctable > width=\"100%\"\u003E\n\t\t\t\u003Ctr\u003E\n\t\t\t\t\u003Ctd > width=\"97%\" align=\"left\" \u003E\n\t\t\t\t\t\u003Cdiv > class=\"recipient_list_style\"\u003E\n\t\t\t\t\t\t\n\t\t\t\t\t\tTammam > Kbeili\t\t\t\t\t\n\t\t\t\t\t\u003C/div\u003E\n\t\t\t\t\u003C/td\u003E\n\t\t > \t\t\u003Ctd > width=\"3%\" align=\"right\"\u003E\n\t\t\t\t\t\u003Cimg > alt=\"Ajax-loader-green\" height=\"15\" > id=\"add_icon_ajax_indicator_recip1\" > src=\"/images/ajax-loader-green.gif?1238481847\" style=\"display:none\" > width=\"15\" /\u003E \t\t\t\t\t\n\t\t\t\t \u003Ca href=\"#\" > onclick=\"new Ajax.Updater('recipients_list_div', > '/sms/remove_client_to_recipients_list?client_id=1\u0026amp;recipient_sessi > on_id=recipients_list', > {asynchronous:true, evalScripts:true, > onLoading:function(request){$('add_icon_ajax_indicator_recip1').show();$('r > emove_client_icon_recip1').hide();}}); > return false;\"\u003E\u003Cimg alt=\"Remove_icon_recip\" border=\"0\" > height=\"15\" id=\"remove_client_icon_recip1\" > src=\"/images/remove_icon_recip.png?1238564525\" title=\"remove > user:Tammam Kbeili from recipients list\" width=\"15\" > /\u003E\u003C/a\u003E\t\t\t\t\t\t\n\t\t\t\t\u003C/td\u003E\n\t\t\t\u003C/tr > \u003E\n\t\t\u003C/table\u003E\n > \u003C/div\u003E\n\n \u003Cb class=\"spiffy\"\u003E\n \u003Cb > class=\"spiffy5\"\u003E\u003C/b\u003E\n \u003Cb > class=\"spiffy4\"\u003E\u003C/b\u003E\n \u003Cb > class=\"spiffy3\"\u003E\u003C/b\u003E\n \u003Cb > class=\"spiffy2\"\u003E\u003Cb\u003E\u003C/b\u003E\u003C/b\u003E\n > \u003Cb > class=\"spiffy1\"\u003E\u003Cb\u003E\u003C/b\u003E\u003C/b\u003E\u003C/b\u0 > 03E\n\u003C/div\u003E\n\n\n\t\n\n\t\t\t\t\t > \t\n\t\t\t\t \u003C/div\u003E\n\t\t > \t\t\u003C/td\u003E\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t \n\t\t\t > \n\t\t\t \t\t\t\t\t\t\t\t\t\n\t\t\t\t\u003Ctd nowrap=\"nowrap\" > width=\"95\" height=\"10\"\u003E\n\t\t\t\t \u003Cdiv > id=\"recipient_client_35\"\u003E\n\t\t\t\t\t\t\u003Cdiv\u003E\n \u003Cb > class=\"spiffy\"\u003E\n \u003Cb > class=\"spiffy1\"\u003E\u003Cb\u003E\u003C/b\u003E\u003C > > Not sure what this is happening. I'm guessing it might be interfering > with something I have on that page such as style or script. > I also tried this in different formats > > Is there any such known issue with Scriptaculous and rails? > > Thanks, > > Tam > -- > 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: Testing: Application controller and helper
Shaum Sona wrote: > How do we test application controller and application helper in rails? Two answers. The best answer is you should use Test-Driven Development, where you write a test that fails because a minor ability of a feature is not there, and you get the test to fail for the correct reason. Then you write a little code to provide the ability and pass the test. The great thing about TDD is you are not required to make sure the test actually calls the exact method that provides the ability. Sometimes that's a good goal, yet TDD provides such comprehensive test coverage that the ideal of "unit" testing becomes less important. You TDD the application controller and helper by firing up the usual functional tests on your usual controllers and views, and TDDing their features. The second answer: El Goog would have lead you to "rails helper tests": http://nubyonrails.com/articles/test-your-helpers The third answer is I don't see why a functional test cannot simply reach out to ApplicationController alone... -- Phlip --~--~-~--~~~---~--~~ 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: Where to store scrape results?
Thanks Andrew for ruling out any doubts i had regarding using yaml. I will cache the reuslts then for around 2 hours in a db. Im now wondering how this will affect the performance of filtering. My guess is that when a user selects some filters on the results screen, these get passed as params back to the controllers index. Logic there will determine its a request to filter existing results and will access the cache in the db and grab the yaml. Then use yaml to turn the info into the relevant objects and then use enumerators find_all method to filter the results... do you think that approach is ok or is there a better way of doing it? many thanks once again. you have been a great help. -- 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: Error reverting back to a previous version of rails
Stephen Fagan wrote: > I want to revert back to a previous version of rails (1.2.3) but the > project I want to work on was created in 2.0.2. I have uninstalled 2.0.2 > and gem installed 1.2.3 but when I run script\server I get the following > error. (I'm guessing its to do with my environment file but I'm pretty > new to Rails so Im not sure.) > > c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:328:in > `send': undefined method `session=' for ActionController::Base:Class > (NoMethodError) > > Anyone any ideas? > > Thanks I have narrowed it down to this piece of code in config\environment.rb: config.action_controller.session = { :session_key => '_linkitb_session', :secret => 'ec87782d1ced62d9adf7bb29f9dea79026c62d16f4a6a3d35098cf198274193355187a784f66d8f3836efa70e5c6c4301c9b6819f7f1c196c3b853a0b6f9148b' } If I comment this out the server boots no problem but I get an error when I open up localhost:3000 in the browser. Has nyone a sloution to this? 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] Including related data in restful results
I am trying to create a restful XML output for a model but also want to include the data from a related table. For example, I have a model called person and the person has multiple photos. I want to include the url of each photo so that the restful user can then retrieve the photos if needed. I know I could create a separate url like person/ 123/photos and that would work, but is an additional query. Either would include a url of the actual photo photo/987. Again I could also do person/123/photo/987 Would I be better off to have the one url of person/123 return the person info along with the photos or separate urls as mentioned above? Also the pros and cons of the extended photo url Thanks Don French --~--~-~--~~~---~--~~ 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: Where to store scrape results?
On Sun, Apr 5, 2009 at 10:31 AM, Adam Akhtar wrote: > > Hi thanks for your replies. > > My main concern is performance. The data is not scraped beforehand in > advance, its scraped on demand by my users. They submit a search query > whch i then perform on several site, scrape their results and aggregate > them for the user. My site is basically a meta search engine. > > Storing results in a db > > pros: i get to use msql find conditions when the user wants to filter > the results even more. > > cons: ill only be temporarily storng these results. As soon as the user > does a new search there gone forever. I dont know the peformance hit of > storing a 1000 results in a db consisting of several fields. Is a db > still a wise choice? > > Using YAML: > > pros: not sure, but hey, i like using it! > cons: no msql conditions so id have to create my own methods > > does the above change anything? > > > > -- > Posted via http://www.ruby-forum.com/. > > > > The benefit of YAML is that once you've scraped the data, you probably already have a structure in place which can easily be saved and restored. You could combine the two by storing the YAML in the database. >From a performance perspective, consider caching the results of the scraping for at least some period of time so that you don't have to scrape on every search (unless the source websites change VERY frequently) Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --~--~-~--~~~---~--~~ 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: Where to store scrape results?
Hi thanks for your replies. My main concern is performance. The data is not scraped beforehand in advance, its scraped on demand by my users. They submit a search query whch i then perform on several site, scrape their results and aggregate them for the user. My site is basically a meta search engine. Storing results in a db pros: i get to use msql find conditions when the user wants to filter the results even more. cons: ill only be temporarily storng these results. As soon as the user does a new search there gone forever. I dont know the peformance hit of storing a 1000 results in a db consisting of several fields. Is a db still a wise choice? Using YAML: pros: not sure, but hey, i like using it! cons: no msql conditions so id have to create my own methods does the above change anything? -- 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] Error reverting back to a previous version of rails
I want to revert back to a previous version of rails (1.2.3) but the project I want to work on was created in 2.0.2. I have uninstalled 2.0.2 and gem installed 1.2.3 but when I run script\server I get the following error. (I'm guessing its to do with my environment file but I'm pretty new to Rails so Im not sure.) c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:328:in `send': undefined method `session=' for ActionController::Base:Class (NoMethodError) Anyone any ideas? 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] Testing: Application controller and helper
How do we test application controller and application helper in rails? Thanks in advance.. - Shauma. -- 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: Where to store scrape results?
You can easily create a table, and stick it in as a row. in rails sqlite is easy enough, if you site is bigger you can use db2. If its like most sites, you make a "result" table that is associated to a user table. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---