Re: [Rails] ajax history.
On 6 January 2011 21:05, Walter Lee Davis wrote: > Wow, sounds like a bug, either in the implementation of pushState by Google > in their page, or by Chrome. Do you have this problem with Safari or > Firefox? My firefox version doesn't support pushState, I've the problem with Crome. When I say "go to an internet site", I said google to make an example, you can go to whatever site you want but when you push the browser back button to call the page in history you see a text page and not an html page. I've read the railscast episode 246 and I have created an application like that in railscast, so I've found this bug. I paginate the list, click on various paginate links, then I go to an internet site, push the back button and the browser call index.js.erb that is in history but I see it like a text file. p.s. sorry for bad english -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Running methods on a class in gem
Craig Leppan wrote in post #972958: > I have installed a gem "Rubygsm and dependencies" > I have the send sms working via the gem > > The following code is from the gem core file for receiving an sms: > > # call-seq: > # receive(callback_method, interval=5, join_thread=false) > # > # Starts a new thread, which polls the device every _interval_ > # seconds to capture incoming SMS and call _callback_method_ > # for each, and polls the device's internal storage for incoming > # SMS that we weren't notified about (some modems don't support > # that). > # > # class Receiver > # def incoming(msg) > # puts "From #{msg.from} at #{msg.sent}:", msg.text > # end > # end This is showing you an example of a custom class that you are expected to write. Say in a file called receiver.rb. > # # create the instances, > # # and start receiving > # rcv = Receiver.new > # m = Gsm::Modem.new "/dev/ttyS0" > # m.receive rcv.method :incoming > # > # # block until ctrl+c > # while(true) { sleep 2 } This is a script that uses the Receiver class. This code can be placed at the end of the receiver.rb file somewhere after declaring and implementing your Receiver class (just like the example here is showing). Or it could exist in it's own file that requires receiver.rb at top. The last line of this file will loop indefinitely with a two second sleep between each loop. Use ctrl+c to stop the program as shown above. Note: I don't see it shown here but you will need to require the gem somewhere at the very top of receiver.rb. Something like: require 'rubygems' require '' In case you'll be using this inside a Rails project somehow then adding the gem to your Gemfile should be sufficient to use the GSM::Modem class I believe. -- 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-t...@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: Finding the previous / next item
Hassan Schroeder wrote in post #972525: > @products is just an Array; you should look through the doc to see > the methods available. You might find Array#index and Array#at of > interest. :-) In other words. A Ruby Array (@products.class => Array) is an ordered list, as opposed to Hash or Set, which store unordered collections of objects. So if you order the records from a fetch such as: @products = Product.order(:name) The Array will maintain the objects in the order specified in the query. And getting next or previous is just as Hassan explained: product = @products.at(3) next_product = product.index(@products.index(product) +1) Note. Don't forget to check the array bounds or you might get unexpected results. -- 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-t...@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: Not able to insert value in rails console
Alpha Blue wrote in post #972808: > More than likely related to this issue: > > https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/closed/#issue/69 Yes. You are correct.. How i am rectify this error?.. Any idea?? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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] Can Redis2Go replace memcahe?
Hey The price difference for 100mb Redis or Memcache is only $5 I may have it wrong, but thought Redis provides very similar functionality, with extra useful functionality Why or when would someone chose Memcache over Redis? Redis is promoted as a way to store sessions, so I assume it is blazingly fast, particularly being memory based? cheers -- 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-t...@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: jQuery vs Prototype re: Rails' helpers
Ants Pants wrote in post #972949: > Aren't the remote helpers built with prototype? > > Best thing I ever did was move away from Prototype. Why? Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from my iPhone -- 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-t...@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: jQuery vs Prototype re: Rails' helpers
If your converting to Rails 3, you'll need to change your code anyway. There are no more remote-specific tags. Instead, the tag names are the same as a normal action. Instead, you'll add a :remote => true. So... while you're at it, I strongly suggest you change to jQuery. HTH, Dan On Jan 6, 4:03 pm, Bill Walton wrote: > I'm considering switching from Prototype to jQuery but wonder... do > the Rails helper methods like form_remote_tag and button_to_remote > work with jQuery 'out of the box' ? > > I've got 2 apps I'd need to convert: one on 2.1.1 and the other on 2.3.2 > > TIA, > Bill -- 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-t...@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] no such file to load -- spec/rake/spectask
I am lost in trying to get rid of the below error when i try to run any rake task. i have installed rspec through the bundler. i did nto have this porblme when running the app as a 2.x rails however i have upgraded to to 3.0.3 and now i am running into this problem. no such file to load -- spec/rake/spectask i have searhced searche and searched to no avail. -- 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-t...@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: Your template plugins/extensions for new project?
Alpha Blue wrote in post #972994: > Marnen Laibow-Koser wrote in post #972993: >> rails-authorization will do this, if I understand your use case >> correctly. I'd avoid bitfields myself. >> >> Best, >> -- >> Marnen Laibow-Koser >> http://www.marnen.org >> mar...@marnen.org >> >> Sent from my iPhone > > No, I looked into all of that. With bitfields I can add authorization > to "anything". Of course you can. You can do likewise with rails-auth. > It's very fast too and I've spent a lot of times working > with it since my days as a developer with vbulletin products. Cynical translation: I've brought my PHP bad habits into Rails. :D Maybe not. I've rolled my own authorization on one project. Honestly, I'm not at all happy with it. I hope to replace it with rails-auth or something. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from my iPhone -- 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-t...@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] [JOBS] Web Services Engineer - Seattle, WA
About the Job: Web Service Engineer Location: Seattle WA - Local Candidates Only Employment Type: Full-Time Compensation: Competitive FTE salary with early stage equity We need people that are smart, creative, funny and technology driven. Be amused. Be moved. Help shape the way people play online. We're looking for a Web Service Engineer with a track record of building and maintaining large scale dynamic web services. You must be a technical leader and core services architect for the team, sharing responsibility with other senior team members for resolving technical problems. You will develop, unit test and implement complex software from the ground up. This position will work with product management and marketing teams to develop core road map and release phases, develop a framework for resourcing current and future release investments. Candidates must understand, review, provide feedback and contribute to software documentation as well as continually research and evaluate new technologies and solutions. Requirements: - 5+ years or more of software development experience - Strong analytic skills - Strong ability to solve problems in imaginative as well as practical ways - Strong communication skills, both written and verbal - Ability to work on multiple overlapped projects concurrently - Ability to work both individually and as part of a team with internal/external members - Ability to create and follow project plans and schedules with a proven track record of delivering on-time - Strong interest and currency in media technologies Experience: - A degree in Computer Science, Math or related field - Past experience in at least one of the following areas – Network topologies with variety of TCP/IP protocols and clients, Information Retrieval, Data Mining, cloud deployment and scale technologies - Experience with building high-performance, highly-available and scalable distributed systems. - Strong design and coding skills in C/C++ on Linux/Unix and PC client Platforms. - Familiar with Perl, Python and have a good understanding of SQL. - Proficiency in C, C++, JavaScript, Java, Ruby and other high-level object-oriented language. - Strong understanding and development experience with common internet delivery protocols desired such as: HTTP, SSL/TLS, UDP, TCP/IP, RTSP, RTP, RTCP, RTMP - Strong understanding and development experience with web development technologies desired such as: Ruby on Rails, App Engine, Servlets, HTML, XML, CSS, JavaScript, Python, JSP, PHP, Tomcat , Apache - Development experience with video applications desired such as: HTML5, Flash, ActionScript, FMS, H.264, Http Live Streaming, RTSP - Development experience with relational databases desired Benefits and Perks: ● Our jobs are really fun. Seriously. ● We don’t offer any medical, dental or vision. But we will share our expertise on how to pay for health care on your own that’s better than what a small start-up like ourselves can offer. ● Stock options aren’t worth anything yet but have the potential to make you really rich someday. ● We have very few office supplies and zero free soft drinks... ● BUT we don’t work crazy hours and we get to enjoy time with our families as much as we enjoy watching viral videos. Send resume and project urls to tech...@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-t...@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] [JOBS] Front-End Web Application Engineer - Seattle, WA
About the Job: Front-End Web Application Engineer Location: Seattle WA (Local candidates only) Employment Type: Full-time Compensation: Competitive FTE salary with early stage equity We need people that are smart, creative, funny and technology driven. Help shape the way people play online. We are looking for a Front-End Web Application Engineer with a track record and passion for developing pixel perfect implementations that are slick, polished and highly responsive. This position will work with our world class team to develop and review specs and requirements from both internal and external sources. You will develop core rich media web application framework to support “episodic” experiences that mix editorial rich content with user contributed content. Requirements: - Experience using modern jQuery, AJAX libraries like Dojo, Django, lazslo, Closure and Ruby/Python/C/C++/Apache/Linux server side technologies - 3+ years building and designing web applications with live reviewable examples - A strong understanding of user recruitment, capture, activity and optimal web flows for subscription, registration, payment, search and browsing activities - A degree in computer science or related discipline is required. Experience: - Experience with best practices for cutting up and styling layouts - bonus points for CSS3 and AJAX experience - Ability to accurately translate even minute details of a design to code that work in all major browsers and major platforms. Having excellent design skills is a bonus -Strong written and verbal communication skills and ability to work on multiple related projects simultaneously Additional responsibilities: - Implement designs from Photoshop/HTMLS/Spec into high quality HTML/ CSS/jscript at warp speed upon existing templates or from scratch, when necessary - Fulfill requests from product management, support and through direct feedback regarding bugs, experience enhancement, additional features and follow on episode planning - Producing clean, unit tested, high quality, standard compliant code, and generating clean requirements for scalable RESTFUL API/back end SQL and Cloud based object and database systems Benefits and Perks: ● Our jobs are really fun. Seriously. ● We don’t offer any medical, dental or vision. But we will share our expertise on how to pay for health care on your own that’s better than what a small start-up like ourselves can offer. ● Stock options aren’t worth anything yet but have the potential to make you really rich someday. ● We have very few office supplies and zero free soft drinks. ● BUT we don’t work crazy hours and we get to enjoy time with our families as much as we enjoy watching viral videos. Send resume to tech...@gmail.com. No recruiters please. -- 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-t...@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 acts_as_taggable_on
You are correct! ruby-1.9.2-p0 > Corp.tag_counts[0].attributes => {"count"=>"19", "id"=>1, "name"=>"law"} Thanks!! Joe On Jan 6, 3:27 pm, Frederick Cheung wrote: > On Jan 6, 9:57 pm, jmcguckin wrote: > > > tag_counts doesn't seem to be working correctly. > > > Ruby 1.9.2, Rails 2.3.5 > > > # From script/console > > > ruby-1.9.2-p0 > Corp.tag_counts > > => [#, #] > > > According to the documentation, I would expect to see a hash of tag- > > name vs. counts entries. > > Actually i think it looks like what you are supposed to get back are > tag objects, but with an extra attribute (a count of the number of > occurences). The default inspects method for AR objects doesn't print > extra attributes, but they're their all the same (call .attributes to > see all that attributes an active record object has) > > Fred > > > > > > > Joe -- 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-t...@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: Your template plugins/extensions for new project?
Marnen Laibow-Koser wrote in post #972993: > rails-authorization will do this, if I understand your use case > correctly. I'd avoid bitfields myself. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org > > Sent from my iPhone No, I looked into all of that. With bitfields I can add authorization to "anything". It's very fast too and I've spent a lot of times working with it since my days as a developer with vbulletin products. -- 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-t...@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: Your template plugins/extensions for new project?
Alpha Blue wrote in post #972991: > devise and that's it for me. With Rails 3, engines are the new thing > and everything I need to keep in an application, is now a part of my > engine. > > Devise is one of the best authentication systems I've found around. > Very clean and modular. > > For permissions/authorizations I developed my own system which is a > bitfields permission system. I used to use cancan, but it lacked what I > needed and that was a way to assign authorization to any object within > my application. rails-authorization will do this, if I understand your use case correctly. I'd avoid bitfields myself. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from my iPhone -- 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-t...@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: Your template plugins/extensions for new project?
devise and that's it for me. With Rails 3, engines are the new thing and everything I need to keep in an application, is now a part of my engine. Devise is one of the best authentication systems I've found around. Very clean and modular. For permissions/authorizations I developed my own system which is a bitfields permission system. I used to use cancan, but it lacked what I needed and that was a way to assign authorization to any object within my application. -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Your template plugins/extensions for new project?
>> Hi all >> >> Not started a Rails project from scratch for a while so I'm curious.. >> What are your "always in" plugins etc that you'd use for a new Rails >> project? >> >> Guess some people use templates for this task? >> >> Not after a battle about why devise is better than >> restful_authentication or >> whatever, just keen to know what's new. Been out the loop for a while. >> >> With thanks >> >> Matt > > Haml (including Sass and maybe Compass), RSpec, Cucumber, Authlogic, > Machinist, fast_gettext. Pickle might get added to that list, and I'll > probably try Devise and Cancan at some point. But those are the > essential set. I'd add will_paginate, fastercsv, settingslogic, and nokogiri to that list. Seems no matter what I start, those always end up in there at some point. Ruby Toolbox is a neat site that will show you whats available for doing various things and how popular they are... http://ruby-toolbox.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-t...@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] ruby script/console error
Hi, I am a newbie in ROR I have an application checked out from repository on a windows machine and have all the required gems installed. I can have the rake commands work with the project but any other. I was trying to run the command from the cmd window C:\sawan\path\to\projectapp>ruby script/console I get the following error :29:in `require': no such file to load -- script/../config/boot (LoadError) from :29:in `require' from script/console:2:in `' and is similar to ruby script\server too Thanks, Sawan. -- 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-t...@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: Your template plugins/extensions for new project?
msp wrote in post #972982: > Hi all > > Not started a Rails project from scratch for a while so I'm curious.. > What are your "always in" plugins etc that you'd use for a new Rails > project? > > Guess some people use templates for this task? > > Not after a battle about why devise is better than > restful_authentication or > whatever, just keen to know what's new. Been out the loop for a while. > > With thanks > > Matt Haml (including Sass and maybe Compass), RSpec, Cucumber, Authlogic, Machinist, fast_gettext. Pickle might get added to that list, and I'll probably try Devise and Cancan at some point. But those are the essential set. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org Sent from my iPhone -- 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-t...@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: Re: Re: Best Practice
Colin Law wrote in post #972816: > I think I misunderstood what you meant, you said: >> I would add a custom param called params[:updatable] to both the create >> an update actions of the controller, and pass the values of true from >> create and false from update to the model. The model allows the field to >> be saved if true. > > I thought you meant pass :updatable from the view to the create and > update actions, but perhaps you meant just set them in the controller > action and then pass them to the model. In that case how would you > interrogate :updatable in the model, given that update_attributes will > be used to do the update? > > Colin Yes, that is what I meant Colin. I actually encountered something similar when going over my forum software that I was working on. I needed to decide how to allow some fields to be updated, but only in specific situations. So, I created a bitfields permissions system for authorization on controller actions and within views. I have a permissions table with action types that have bits assigned. I can define permissions for all objects, including users, controllers, views, and even models. I'll give you a brief idea: https://gist.github.com/768843 But, to answer your question, I would interrogate the action with bitfield permissions. -- 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-t...@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 acts_as_taggable_on
On Jan 6, 9:57 pm, jmcguckin wrote: > tag_counts doesn't seem to be working correctly. > > Ruby 1.9.2, Rails 2.3.5 > > # From script/console > > ruby-1.9.2-p0 > Corp.tag_counts > => [#, #] > > According to the documentation, I would expect to see a hash of tag- > name vs. counts entries. Actually i think it looks like what you are supposed to get back are tag objects, but with an extra attribute (a count of the number of occurences). The default inspects method for AR objects doesn't print extra attributes, but they're their all the same (call .attributes to see all that attributes an active record object has) Fred > > Joe -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Problem with acts_as_taggable_on
tag_counts doesn't seem to be working correctly. Ruby 1.9.2, Rails 2.3.5 # From script/console ruby-1.9.2-p0 > Corp.tag_counts => [#, #] According to the documentation, I would expect to see a hash of tag- name vs. counts entries. Joe -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Your template plugins/extensions for new project?
My two cents: haml compass nifty-generators rails3-generators yard (for documentation) shoulda factory_girl devise / nifty_authentication (heavy / lightweight) cancan (for roles/rights security) Garrett On Jan 6, 2011, at 5:12 PM, msp wrote: > Hi all > > Not started a Rails project from scratch for a while so I'm curious.. > What are your "always in" plugins etc that you'd use for a new Rails project? > > Guess some people use templates for this task? > > Not after a battle about why devise is better than restful_authentication or > whatever, just keen to know what's new. Been out the loop for a while. > > With thanks > > 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-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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] Your template plugins/extensions for new project?
Hi all Not started a Rails project from scratch for a while so I'm curious.. What are your "always in" plugins etc that you'd use for a new Rails project? Guess some people use templates for this task? Not after a battle about why devise is better than restful_authentication or whatever, just keen to know what's new. Been out the loop for a while. With thanks 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: cucumber stories for Ajax in rails3
> Time for Google. Yes, these are serious and meaningful statements. (Ruby programmers do have a penchant for making libraries with strange names...) most of what i said was kinda sarcastic (though i dont know about what they were talking about) and yeah, i understand libraries with strange names (and it's not just ruby, it's most of the OSS movement... penguin mascot for linux, the recursively recursive definition for HURD, anything _why did... just to name a few) -- 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-t...@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] parse.rb:33: [BUG] Segmentation fault ruby 1.8.7 Hpricot
Has anyone had this issue above with hpricot? I cannot seem to find a solution that works. -- 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-t...@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: Re: rails console not working with my application
Walter Davis wrote in post #972969: > On Jan 6, 2011, at 5:01 PM, Sawan T. wrote: > >> Thanks >> Sawan." > > > I believe you can always force a particular version of rails at the > command line by using this syntax: > > rails_2.3.5 script/whatever > > But the smart money is on RVM. > > Walter Thanks Walter for your reply, I used the syntax rails_2.3.5 script/console nothing happened. Then I tried to see the rails version by using rails -v and it gave me 3.0.3... is there anyway that I can have the app use verson 2.3.5 -- 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-t...@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: Re: rails console not working with my application
Walter Davis wrote in post #972969: > On Jan 6, 2011, at 5:01 PM, Sawan T. wrote: > >> Thanks >> Sawan." > > > I believe you can always force a particular version of rails at the > command line by using this syntax: > > rails_2.3.5 script/whatever Actually, that's rails _2.3.5_ whatever other arguments. But that won't make a difference here: Rails 2 doesn't have all the script/* stuff subsumed under the rails command the way Rails 3 does. > > But the smart money is on RVM. > > Walter Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Re: Re: recommended HTTP client?
Greg Donald wrote in post #972968: > On Thu, Jan 6, 2011 at 4:04 PM, Marnen Laibow-Koser > wrote: >>> depending on a gem is >>> forever. >> >> No it's not, unless your tests are that bad. > > Depending on a gem or not has not a f*cking thing to do with tests. > > I'm adding you to my kill file, you have proven time and again you are > an utter moron. If that means I no longer have to put up with your misinformed sniping, then good riddance. The list will be a happier place. > > > -- > Greg Donald > destiney.com | gregdonald.com Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: rails console not working with my application
On Jan 6, 2011, at 5:01 PM, Sawan T. wrote: "I have gem list rails showing me 3.0.3, 3.0.0 and 2.3.5 is it anything to do with your app_config.rb and I dont see any in vendor/rails its all have some plugin folders. I am working with tutorials which needed those rails version and 2.3.5 since my app needs it. I think the rails version will render to the needed Thanks Sawan." I believe you can always force a particular version of rails at the command line by using this syntax: rails_2.3.5 script/whatever But the smart money is on RVM. Walter -- 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-t...@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] Can I force an update to nested attributes to always save new children?
I have a Rails 2.3.10 application like this: Campaign has one or many AdUnits which each have one or many Ads. (Each ad has a file attached to it with Paperclip.) I currently have vestal_versions on the Ads, which allows me to track the history of an ad as it moves through the approval process. But now the client would like me to move versions up to the AdUnit level, and vestal_versions doesn't track associated records like this. I had the bright idea of rigging the AdUnit#update method so that instead of updating the nested Ads, it would create and link new Ads. Then I could update my version record with a hash or array of the new ad_id values within that AdUnit and use that array to re-find the correct children whenever I need to display an older version. This would also get around Paperclip's insistence on deleting the previous version of an attached file whenever you update an existing record. (I currently have that monkey-patched so it keeps everything and appends the filename with the version id.) So, is this over-thinking things? If not, how would you do this? On the other hand, is there another way to do this? The key requirement is that I be able to rewind an AdUnit to some point in the past, when it had different versions of the same N ads and show the AdUnit as it stood at that point to a visitor; so I never want to throw away any ads or their Paperclipped file attachments, and I want each update of an AdUnit to create a new vestal_version that "knows" which N Ads belong to it. I realize this is kind of backwards of how these relationships usually work -- a child knows who its parent is, but the parent doesn't store the child ids in its object (where they could become a part of the shadow version table). Thanks in advance, Walter -- 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-t...@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: Forcing PUT vs. POST in form
James Byrne wrote in post #972964: > Interestingly, w3.org indicates that there are only two valid HTTP verbs > for the form and the submit elements. Those are GET and POST. Exactly. Which is why Rails fakes PUT forms as I explained earlier. It's a POST as far as the browser is concerned, but a PUT as far as Rails is concerned. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Re: recommended HTTP client?
Greg Donald wrote in post #972952: > On Thu, Jan 6, 2011 at 3:29 PM, Marnen Laibow-Koser > wrote: >> Not necessarily true. *You* didn't have to write the 1000 lines, and >> you didn't have to write the extra 10 lines. Where's the downside? > > Writing 10 lines of code takes a couple minutes, And installing a gem takes 30 seconds. (In this case, I'd probably write the 10 lines, but not if the numbers were a little different.) > depending on a gem is > forever. No it's not, unless your tests are that bad. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Forcing PUT vs. POST in form
Interestingly, w3.org indicates that there are only two valid HTTP verbs for the form and the submit elements. Those are GET and POST. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Forceing PUST vs. POST in form
James Byrne wrote in post #972959: >> No! If you need to make the form submission GET, then something is >> *badly wrong*. Rails' resource mapping should make the PUT form work by >> default. If that isn't working, find out why. Perhaps we should take a >> look at your routes. >> > > I believe that I know the source of the problem. I have deliberately > created a merged edit/new form and forced the controller to map > different methods to specific templates. I do not intend for this to > remain. But I am interested in seeing what behaviour results. It's common to "merge" the new and edit forms. The body of the form goes into a partial that the two views (new and edit) share. That's the cleanest and most direct way to accomplish what it sounds like you want. -- 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-t...@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 console not working with my application
Marnen Laibow-Koser wrote in post #972937: > Sawan T. wrote in post #972932: >> Marnen Laibow-Koser wrote in post #972926: >>> Sawan T. wrote in post #972924: Hi I have couple of issues with my application. I have an app checked out from a repository on to my local machine. rake commands like rake db:create and rake db:migrate and gem list, gem install are working with the app but not any other commands like rails generate scaffold User username:string, rails server, rails console following is the error Then there's your problem. The syntax of the rails command changed > between versions 2 and 3. The usage message you provided comes from > version 3. So...you've got Rails 3's command-line script, and a Rails 2 > application. Do you have the Rails 2.3.5 gem available at all? (Check > gem list rails and the vendor/rails directory in your app.) > > That's a problem right there. If you can work on a Mac or other *nix > box, do. If not, download Virtual Rails. > > And I highly recommend using RVM (if you're on *nix) to give this > application its own gemset. (If you *must* work on Windows, I > understand pik is similar.) > >> its weird because applications >> I have created on my local machine using rails new myapp works and all >> the other commands work with myapp.. I can create new controller new >> model or even add a column to the existing migration table etc..." > > Right. Because those are Rails 3 apps. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org "I have gem list rails showing me 3.0.3, 3.0.0 and 2.3.5 is it anything to do with your app_config.rb and I dont see any in vendor/rails its all have some plugin folders. I am working with tutorials which needed those rails version and 2.3.5 since my app needs it. I think the rails version will render to the needed Thanks Sawan." -- 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-t...@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: Forceing PUST vs. POST in form
Marnen Laibow-Koser wrote in post #972947: > No! If you need to make the form submission GET, then something is > *badly wrong*. Rails' resource mapping should make the PUT form work by > default. If that isn't working, find out why. Perhaps we should take a > look at your routes. > I believe that I know the source of the problem. I have deliberately created a merged edit/new form and forced the controller to map different methods to specific templates. I do not intend for this to remain. But I am interested in seeing what behaviour results. -- 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-t...@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] Running methods on a class in gem
I have installed a gem "Rubygsm and dependencies" I have the send sms working via the gem The following code is from the gem core file for receiving an sms: # call-seq: # receive(callback_method, interval=5, join_thread=false) # # Starts a new thread, which polls the device every _interval_ # seconds to capture incoming SMS and call _callback_method_ # for each, and polls the device's internal storage for incoming # SMS that we weren't notified about (some modems don't support # that). # # class Receiver # def incoming(msg) # puts "From #{msg.from} at #{msg.sent}:", msg.text # end # end # # # create the instances, # # and start receiving # rcv = Receiver.new # m = Gsm::Modem.new "/dev/ttyS0" # m.receive rcv.method :incoming # # # block until ctrl+c # while(true) { sleep 2 } # # Note: New messages may arrive at any time, even if this method's # receiver thread isn't waiting to process them. They are not lost, # but cached in @incoming until this method is called. def receive(callback, interval=5, join_thread=false) @polled = 0 The working code end # Modem end # Gsm Where do I setup the actions and where should I place the method calls to the object in this class All the hashes above are descriptions I believe on how to call the methods but need guidance. Can I define a class within a class, say messages? I tried this but I dont think I can I have run it in console in my app and get failures -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: How to make this SQL Query?
Hi thoen, Well.. i tried to use your query... select distinct courses.* from courses inner join course_times monday_courses on courses.id = monday_courses.course_id and monday_courses.time_id = 1 left outer join course_times non_monday_courses on courses.id = non_monday_courses.course_id and non_monday_courses.time_id <> 1 where non_monday_courses.id is null but, actually, in my database, at times table, i have another attribute like the hour of the course and so, i cant ask non_monday_courses.time_id <> 1, because actually i dont know if what i want to search is the register of id =1 of my courses_times table, i only know things about times... i have to make a join in the times table and ask times.day <> 'Seg', could you understand? i wasn't so clear... how could i make your query but using times.day <> 'Seg' instead of non_monday_courses <> 1 ??? Thanks Fernando 2011/1/6 Marnen Laibow-Koser > ppgeng...@prevailhs.com wrote in post #972869: > > On Jan 5, 12:10pm, Marnen Laibow-Koser wrote: > >> syntax, without proprietary extensions. This gives the best portability > >> across databases. > > > > Just tacking on another suggestion to this if people are reading back > > through here: if you do need literal SQL its a good idea to put it in > > a configuration file with a lookup key > > (i.e. :count_all_my_angry_birds); > > Why not just use a named scope (or the Rails 3 equivalent)? That's what > I tend to do for complex queries. Granted, you don't get all the SQL in > one file, but that's a *good* thing: it means you're looking at the SQL > in context. > > I want to like your config file idea, but I think it's just reinventing > stored procedures in a way that removes their remaining advantages. > > > that way if you switch db engines or > > support multiple ones all your specific SQL is in one location that > > you can ensure works for whatever different dbs you need to support. > > And of course keep that file as ANSI compliant so that there are as > > little changes required as possible. > > ...in which case your proposed solution isn't necessary anyway. :) > > > > > \Peter > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: recommended HTTP client?
On Thu, Jan 6, 2011 at 3:29 PM, Marnen Laibow-Koser wrote: > Not necessarily true. *You* didn't have to write the 1000 lines, and > you didn't have to write the extra 10 lines. Where's the downside? Writing 10 lines of code takes a couple minutes, depending on a gem is forever. -- Greg Donald destiney.com | gregdonald.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-t...@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: Re: Get a value from previous page
Colin Law wrote in post #972821: > On 6 January 2011 14:25, Jose tomas R. wrote: > > Please quote the previous message and insert your comments at the > appropriate point, this makes it easier to follow the thread. > >> I dont need @order ar params I need it as a value > > I have no idea what you mean by that. params[:order] *is* a value. > You can say > @order = params[:order] > > If I misunderstand your problem please try to explain again. > > Colin So --- <%= link_to 'cost', :action => 'search', :order_by => 'cost' %> --- def search @order = params[:order_by] @cars = Car.paginate :page => params[:page], :order => @order respond_to do |format| format.html # index.html.erb format.xml { render :xml => @cars } end end --- Will order my Cars by it cost? -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] jQuery vs Prototype re: Rails' helpers
Aren't the remote helpers built with prototype? Best thing I ever did was move away from Prototype. On 6 January 2011 22:03, Bill Walton wrote: > I'm considering switching from Prototype to jQuery but wonder... do > the Rails helper methods like form_remote_tag and button_to_remote > work with jQuery 'out of the box' ? > > I've got 2 apps I'd need to convert: one on 2.1.1 and the other on 2.3.2 > > TIA, > Bill > > -- > 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-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: recommended HTTP client?
Tony Primerano wrote in post #972944: [...] > If a 1000 line gem is saving me 10 lines of code I'm better off not > using it. Not necessarily true. *You* didn't have to write the 1000 lines, and you didn't have to write the extra 10 lines. Where's the downside? (I'm not saying you should put random crap into your application, but sometimes a library really is the simplest solution.) > Gems like authlogic are essential. If I needed more HTTParty features > I would use it but for now the standard library is just fine. :-) Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Forceing PUST vs. POST in form
James Byrne wrote in post #972946: > Marnen Laibow-Koser wrote in post #972943: > >> >> You probably don't want the form submission to be GET. >> > You are probably right. But for now I am simply exploring how things > work for a nested resource. I will rewire the controller when I figure > how what I want each bit to do and how I want it to look. No! If you need to make the form submission GET, then something is *badly wrong*. Rails' resource mapping should make the PUT form work by default. If that isn't working, find out why. Perhaps we should take a look at your routes. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Forceing PUST vs. POST in form
Marnen Laibow-Koser wrote in post #972943: > > You probably don't want the form submission to be GET. > You are probably right. But for now I am simply exploring how things work for a nested resource. I will rewire the controller when I figure how what I want each bit to do and how I want it to look. -- 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-t...@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: Trouble inserting large objects into memcached
Ha ha - now it is an option! But only for the last two years so I don't feel stupid for doing what I did. >From the memcached man page on OS X: " -I Override the default size of each slab page. Default is 1mb. Default is 1m, minimum is 1k, max is 128m. Adjusting this value changes the item size limit. Beware that this also increases the number of slabs (use -v to view), and the overal memory usage of memcached." Wes -- 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-t...@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: recommended HTTP client?
On Jan 6, 3:04 pm, Marnen Laibow-Koser wrote: > Please quote when replying. > > Tony Primerano wrote in post #972913: > > > It looks like HTTParty uses Net::HTTP so I'll just stick with that. > > Stick with *which*? > I'll just call Net::HTTP directly. I have a simple GET request that returns some simple CSV data. > > > > I got burned by so many deprecated gems moving from Rails 2 to Rails 3 > > that use them sparingly now. :-\ > > I see this attitude a lot, and I believe it is silly. If there's > already a library out there that makes your life easier, don't reinvent > the wheel. Laziness is one of the cardinal virtues for programmers! I'm not really reinventing the wheel here. HTTParty is fine but I just wanted a connection timeout via Net::HTTP, which I learned how to do by looking at HTTParty code. If a 1000 line gem is saving me 10 lines of code I'm better off not using it. Gems like authlogic are essential. If I needed more HTTParty features I would use it but for now the standard library is just fine. :-) > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...@marnen.org > > -- > 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-t...@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: Forceing PUST vs. POST in form
James Byrne wrote in post #972938: > Marnen Laibow-Koser wrote in post #972933: > >> >> But you came from it as GET, not PUT. Routes include method, not just >> URL. >> > > I knew that. Nonetheless that is the bit I had confused. I was trying > to override the form method for the right reason but I fixed upon the > wrong method, PUT, instead of GET. > > Thank you for the help. You probably don't want the form submission to be GET. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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] jQuery vs Prototype re: Rails' helpers
Bill Walton wrote in post #972936: > I'm considering switching from Prototype to jQuery but wonder... do > the Rails helper methods like form_remote_tag and button_to_remote > work with jQuery 'out of the box' ? > > I've got 2 apps I'd need to convert: one on 2.1.1 and the other on 2.3.2 I understand that the jRails plugin will do at least some of what you want. But as you know, I think that Rails 2's JS helpers are anathema and should never be used, because of the inline JS they create. This might be a good time to drop them. > > TIA, > Bill Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Forceing PUST vs. POST in form
Marnen Laibow-Koser wrote in post #972933: > > But you came from it as GET, not PUT. Routes include method, not just > URL. > I knew that. Nonetheless that is the bit I had confused. I was trying to override the form method for the right reason but I fixed upon the wrong method, PUT, instead of GET. Thank you for the 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-t...@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 console not working with my application
Sawan T. wrote in post #972932: > Marnen Laibow-Koser wrote in post #972926: >> Sawan T. wrote in post #972924: >>> Hi I have couple of issues with my application. I have an app checked >>> out from a repository on to my local machine. rake commands like rake >>> db:create and rake db:migrate and gem list, gem install are working with >>> the app but not any other commands like rails generate scaffold User >>> username:string, rails server, rails console >>> >>> following is the error >>> >>> Usage: >>> rails new APP_PATH [options] >> >> Hmm. Is the app Rails 3 or Rails 2? If you don't know, try going to >> the app root directory and typing script/about (at least, this works for >> Rails 2 apps). >> >> Best, >> -- >> Marnen Laibow-Koser >> http://www.marnen.org >> mar...@marnen.org > > "Hi Marnen thanks for the reply. I know the application version is 2.3.5 > and it is mentioned in my environment.rb file Then there's your problem. The syntax of the rails command changed between versions 2 and 3. The usage message you provided comes from version 3. So...you've got Rails 3's command-line script, and a Rails 2 application. Do you have the Rails 2.3.5 gem available at all? (Check gem list rails and the vendor/rails directory in your app.) > and even when I tried to > do as you said"app root directory and typing script/about" it did not do > anything but gave the same error message like previous. I forgot to tell > you that I'm working on windows machine.. That's a problem right there. If you can work on a Mac or other *nix box, do. If not, download Virtual Rails. And I highly recommend using RVM (if you're on *nix) to give this application its own gemset. (If you *must* work on Windows, I understand pik is similar.) > its weird because applications > I have created on my local machine using rails new myapp works and all > the other commands work with myapp.. I can create new controller new > model or even add a column to the existing migration table etc..." Right. Because those are Rails 3 apps. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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] jQuery vs Prototype re: Rails' helpers
I'm considering switching from Prototype to jQuery but wonder... do the Rails helper methods like form_remote_tag and button_to_remote work with jQuery 'out of the box' ? I've got 2 apps I'd need to convert: one on 2.1.1 and the other on 2.3.2 TIA, Bill -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: rails console not working with my application
On 6 January 2011 20:55, Sawan T. wrote: > Marnen Laibow-Koser wrote in post #972926: >> Sawan T. wrote in post #972924: >>> Hi I have couple of issues with my application. I have an app checked >>> out from a repository on to my local machine. rake commands like rake >>> db:create and rake db:migrate and gem list, gem install are working with >>> the app but not any other commands like rails generate scaffold User >>> username:string, rails server, rails console >>> >>> following is the error >>> >>> Usage: >>> rails new APP_PATH [options] >> >> Hmm. Is the app Rails 3 or Rails 2? If you don't know, try going to >> the app root directory and typing script/about (at least, this works for >> Rails 2 apps). >> >> Best, >> -- >> Marnen Laibow-Koser >> http://www.marnen.org >> mar...@marnen.org > > "Hi Marnen thanks for the reply. I know the application version is 2.3.5 > and it is mentioned in my environment.rb file and even when I tried to > do as you said"app root directory and typing script/about" it did not do > anything but gave the same error message like previous. I forgot to tell > you that I'm working on windows machine.. its weird because applications > I have created on my local machine using rails new myapp works and all > the other commands work with myapp.. I can create new controller new > model or even add a column to the existing migration table etc..." Have you installed rails 2.3.5? gem list should show you which versions you have installed. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Forceing PUST vs. POST in form
James Byrne wrote in post #972930: > Marnen Laibow-Koser wrote in post #972921: >> James Byrne wrote in post #972918: > >>> >>> Then does that mean one must always provide a route for the new method, >>> even if it makes no sense to do so within a given context? >> >> I don't understand your question. >> > > I get this error when I submit the form. > > no route exists for "/users/1/roles" Do you have a route defined with method PUT? > > However, I get to the form via "/users/1/roles/new" called from > "/users/1/role", What do you mean by that? The previous page is irrelevant -- HTTP is stateless, remember? So...describe exactly how you get here > which is where I want to return to after the update > completes. *Which* page is where you want to return to? What does the controller action look like? > At the moment I am perplexed by this, to me, mysterious > behaviour and error message. > > In other words, I can start by entering > http://localhost:3000/users/1/roles > > That URL displays all the roles associated with User.find(1) Right. Standard RESTful nested resources (on GET). > > From that page I follow a link to > http://localhost:3000/users/1/roles/new > which displays the input form. When I complete and submit the form I > get this error: > > No route matches "/users/1/roles" > > which is the very URL I have just come from. But you came from it as GET, not PUT. Routes include method, not just URL. What's your rake routes output like for these paths? Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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 console not working with my application
Marnen Laibow-Koser wrote in post #972926: > Sawan T. wrote in post #972924: >> Hi I have couple of issues with my application. I have an app checked >> out from a repository on to my local machine. rake commands like rake >> db:create and rake db:migrate and gem list, gem install are working with >> the app but not any other commands like rails generate scaffold User >> username:string, rails server, rails console >> >> following is the error >> >> Usage: >> rails new APP_PATH [options] > > Hmm. Is the app Rails 3 or Rails 2? If you don't know, try going to > the app root directory and typing script/about (at least, this works for > Rails 2 apps). > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org "Hi Marnen thanks for the reply. I know the application version is 2.3.5 and it is mentioned in my environment.rb file and even when I tried to do as you said"app root directory and typing script/about" it did not do anything but gave the same error message like previous. I forgot to tell you that I'm working on windows machine.. its weird because applications I have created on my local machine using rails new myapp works and all the other commands work with myapp.. I can create new controller new model or even add a column to the existing migration table etc..." -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
[Rails] Re: Send email with delayed job
Dumb question: wouldn't you just change the parameter(s) when you call enqueue()? On Jan 6, 3:46 pm, Greg Ma wrote: > But in my notifier model I have X methods, does it mean I have to create > a different Struc for each methods? -- 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-t...@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: Forceing PUST vs. POST in form
Marnen Laibow-Koser wrote in post #972921: > James Byrne wrote in post #972918: >> >> Then does that mean one must always provide a route for the new method, >> even if it makes no sense to do so within a given context? > > I don't understand your question. > I get this error when I submit the form. no route exists for "/users/1/roles" However, I get to the form via "/users/1/roles/new" called from "/users/1/role", which is where I want to return to after the update completes. At the moment I am perplexed by this, to me, mysterious behaviour and error message. In other words, I can start by entering http://localhost:3000/users/1/roles That URL displays all the roles associated with User.find(1) >From that page I follow a link to http://localhost:3000/users/1/roles/new which displays the input form. When I complete and submit the form I get this error: No route matches "/users/1/roles" which is the very URL I have just come from. -- 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-t...@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] Send email with delayed job
Hi, I want to send email with delayed job. In order to do so, I have a Notifier model with X methods sending different type of emails. In the documentation, they suggest to send email like this: class NewsletterJob < Struct.new(:text, :emails) def perform emails.each { |e| NewsletterMailer.deliver_text_to_email(text, e) } end end But in my notifier model I have X methods, does it mean I have to create a different Struc for each methods? Greg -- 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-t...@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 console not working with my application
Sawan T. wrote in post #972924: > Hi I have couple of issues with my application. I have an app checked > out from a repository on to my local machine. rake commands like rake > db:create and rake db:migrate and gem list, gem install are working with > the app but not any other commands like rails generate scaffold User > username:string, rails server, rails console > > following is the error > > Usage: > rails new APP_PATH [options] Hmm. Is the app Rails 3 or Rails 2? If you don't know, try going to the app root directory and typing script/about (at least, this works for Rails 2 apps). Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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] Devise login with user or admin models and Basecamp style subdomains
I have separate models for Devise users and admins. I am also using Basecamp style subdomains. Everything is working well except for a few controllers and actions where I need to be able to authenticate as either a user or as an admin. Currently I have authenticate_user! set in my application_controller.rb and I am skipping it with skip_before_filter for those controllers and actions that only admins should have access to. Unfortunately I cannot simply specify the authentication requirement on each controller as I will still need some controllers and action to be access by both a User or an Admin. I have tried a few things to no avail. It seems that if I move the authenticate_user! and authenticate_admin! into some sort of subdomain detection logic it fails to process. Basically: current_subdomain = request.subdomains.first if current_subdomain == 'admin' authenticate_admin! else authenticate_user! end I was, at one point, able to get it to attempt authentication but for some reason it was failing to except the session controller from needing authentication which resulted in a redirection loop (a first for me with Ruby!). I realize that I could add a field to my User that denotes admin status, but the application requires a greater separation of powers between User and Admin than that will allow, except for a few controllers and actions. Ruby 1.9.2 Rails 3.0.3 Devise 1.1.3 -- 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-t...@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 console not working with my application
Hi I have couple of issues with my application. I have an app checked out from a repository on to my local machine. rake commands like rake db:create and rake db:migrate and gem list, gem install are working with the app but not any other commands like rails generate scaffold User username:string, rails server, rails console following is the error Usage: rails new APP_PATH [options] Options: -r, [--ruby=PATH] # Path to the Ruby binary of your choice # Default: C:/Ruby192/bin/ruby.exe -d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db) # Default: sqlite3 -b, [--builder=BUILDER] # Path to an application builder (can be a filesystem path or URL) -m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL) [--dev] # Setup the application with Gemfile pointing to your Rails checkout [--edge]# Setup the application with Gemfile pointing to Rails repository [--skip-gemfile]# Don't create a Gemfile -O, [--skip-active-record] # Skip Active Record files -T, [--skip-test-unit] # Skip Test::Unit files -J, [--skip-prototype] # Skip Prototype files -G, [--skip-git]# Skip Git ignores and keeps Runtime options: -f, [--force]# Overwrite files that already exist -p, [--pretend] # Run but do not make any changes -q, [--quiet]# Supress status output -s, [--skip] # Skip files that already exist Rails options: -v, [--version] # Show Rails version number and quit -h, [--help] # Show this help message and quit Description: The 'rails new' command creates a new Rails application with a default directory structure and configuration at the path you specify. Example: rails new ~/Code/Ruby/weblog This generates a skeletal Rails installation in ~/Code/Ruby/weblog. See the README in the newly created application to get going. -- 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-t...@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: Forceing PUST vs. POST in form
James Byrne wrote in post #972918: > Marnen Laibow-Koser wrote in post #972876: >> James Byrne wrote in post #972875: >>> I am experimenting with a combined form. I wish to force the HTTP verb >>> for this form to PUT. However, it always uses POST when submitted and I >>> cannot determine why. >> >> Because that's the way Rails works. Many browsers don't support PUT >> forms, so Rails leaves the method as POST and adds a hidden field to >> fake what the method "really" is. Rails does the processing of that >> hidden field transparently, so that a POST with method "_put" will >> appear to the framework exactly like a real PUT. >> > > Then does that mean one must always provide a route for the new method, > even if it makes no sense to do so within a given context? I don't understand your question. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Forceing PUST vs. POST in form
Marnen Laibow-Koser wrote in post #972876: > James Byrne wrote in post #972875: >> I am experimenting with a combined form. I wish to force the HTTP verb >> for this form to PUT. However, it always uses POST when submitted and I >> cannot determine why. > > Because that's the way Rails works. Many browsers don't support PUT > forms, so Rails leaves the method as POST and adds a hidden field to > fake what the method "really" is. Rails does the processing of that > hidden field transparently, so that a POST with method "_put" will > appear to the framework exactly like a real PUT. > Then does that mean one must always provide a route for the new method, even if it makes no sense to do so within a given context? -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] ajax history.
On Jan 6, 2011, at 2:55 PM, Mauro wrote: On 6 January 2011 19:14, Walter Lee Davis wrote: On Jan 6, 2011, at 12:56 PM, Mauro wrote: I've seen that railscast, I'm using chrome which support pushState. The problem is that ajax history with paginate works but if you, for example, go to a site www.google.it or whatever internet site and then push browser back button the page showed isn't an html page, but it seems a text page. Try. Watching that 'cast, it seemed to me that you could bookmark the resulting URL, and restore your search/pagination/whatever state just fine. I haven't tried the google.it page in this respect, but if the URL changes to show the unique address of the current state of the page, then that's the goal and the goal has been met. Back button or bookmark and new session, it should appear the same either way. You create a list and paginate through this using ajax just like the railscast example. Then go to a internet site. Then push the browser back button and you see the page in history as text and not as an html page. Wow, sounds like a bug, either in the implementation of pushState by Google in their page, or by Chrome. Do you have this problem with Safari or Firefox? Walter -- 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-t...@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: recommended HTTP client?
Please quote when replying. Tony Primerano wrote in post #972913: > It looks like HTTParty uses Net::HTTP so I'll just stick with that. Stick with *which*? > > I got burned by so many deprecated gems moving from Rails 2 to Rails 3 > that use them sparingly now. :-\ I see this attitude a lot, and I believe it is silly. If there's already a library out there that makes your life easier, don't reinvent the wheel. Laziness is one of the cardinal virtues for programmers! Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Falied to create jruby instance errror message
Sarah Ww wrote in post #972911: > I'm sorry but i am a bit computer illterate Then get a little less so before you start programming. > and i am not sure how to proceed with these error messasges > > Would reinstalling glassfish be worth trying? I don't know. I think Glassfish probably has its own support forum; you might ask there. However, I would recommend *not* starting Rails development with JRuby, and *not* starting Rails development on Windows. Both of these will make setup difficult. If you don't have access to a Mac or other *nix box, then you can download Virtual Rails (caveat: I've never used it, but I've heard great things about it), which will save you the setup and give you a ready-made Linux VM for Rails development. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: recommended HTTP client?
It looks like HTTParty uses Net::HTTP so I'll just stick with that. I got burned by so many deprecated gems moving from Rails 2 to Rails 3 that use them sparingly now. :-\ On Jan 4, 10:53 am, Marnen Laibow-Koser wrote: > TonyPrimeranowrote in post #972234: > > > > > In the past I have used Net::HTTPto call trivial remote services. > > These calls have been low frequency so didn't bother looking into > > alternatives. > > > I'm now looking at a design where I will be calling a remote service > > that returns a simple CSV but it will be called frequently and if that > > service goes down I need to degrade gracefully. I'd like to punt if > > the web service fails to respond in 1 second (500 ms may be better). > > > Is there a library that makes this simple. Seems like some hackery is > > needed to make this happen with Net::HTTP > > ex: > >http://groups.google.com/group/chicagoruby/browse_thread/thread/8b8aa... > > > It seems like there are 100s of rubyhttplibraries out there. > > Would HTTParty have what you need? > > > > > Tony > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...@marnen.org > > -- > 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-t...@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: Falied to create jruby instance errror message
I'm sorry but i am a bit computer illterate and i am not sure how to proceed with these error messasges Would reinstalling glassfish be worth trying? -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] ajax history.
On 6 January 2011 19:14, Walter Lee Davis wrote: > > On Jan 6, 2011, at 12:56 PM, Mauro wrote: > >> I've seen that railscast, I'm using chrome which support pushState. >> The problem is that ajax history with paginate works but if you, for >> example, go to a site www.google.it or whatever internet site and then >> push browser back button the page showed isn't an html page, but it >> seems a text page. >> Try. >> > > > Watching that 'cast, it seemed to me that you could bookmark the resulting > URL, and restore your search/pagination/whatever state just fine. I haven't > tried the google.it page in this respect, but if the URL changes to show the > unique address of the current state of the page, then that's the goal and > the goal has been met. Back button or bookmark and new session, it should > appear the same either way. > You create a list and paginate through this using ajax just like the railscast example. Then go to a internet site. Then push the browser back button and you see the page in history as text and not as an html page. -- 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-t...@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: Ruby on Rails for Healthcare systems
Walter Davis wrote in post #972903: > On Jan 6, 2011, at 2:23 PM, SW Engineer wrote: > >> Being interested in applying "Ruby on Rails" to the Healthcare sector >> (IT Healthcare), what do you recommend me to do as a next step after >> learning "Ruby on Rails"? In other words, what PATHWAY do you >> recommend >> someone to approach in applying Ruby on Rails to healthcare especially >> the CAD (Computer-Aided Diagnosis) systems? > > > A smart person told me years ago, "You can't automate something that > doesn't already work on paper." By paper, he meant "in real life". So > I would say that all the Rails in the world won't help you unless you > know what your application is supposed to do, and how it already works > in the real world. > > Walter Thanks @Walter for your reply. The application will most likely be a system that helps in diagnosing "Lung cancer", by for example comparing a scan with other scans in the database that look similar, based on which we can aid the physicican (Radiologist)in giving his diagnosis. But, I really asked my question generally because I'm asking about the "Healthcare IT" in general since I think what I'm thinking about is part of this field. So, before being specific, I just wanted to know what is recommended as a pathway especially for Ruby on Rails developers, and that is why I chose to ask such question in a Ruby on Rails related forum. I'm interested in the opinion of the Ruby on Rails developers in approaching such field. 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Ruby on Rails for Healthcare systems
On Jan 6, 2011, at 2:23 PM, SW Engineer wrote: Being interested in applying "Ruby on Rails" to the Healthcare sector (IT Healthcare), what do you recommend me to do as a next step after learning "Ruby on Rails"? In other words, what PATHWAY do you recommend someone to approach in applying Ruby on Rails to healthcare especially the CAD (Computer-Aided Diagnosis) systems? A smart person told me years ago, "You can't automate something that doesn't already work on paper." By paper, he meant "in real life". So I would say that all the Rails in the world won't help you unless you know what your application is supposed to do, and how it already works in the real world. Walter -- 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-t...@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] Ruby on Rails for Healthcare systems
Being interested in applying "Ruby on Rails" to the Healthcare sector (IT Healthcare), what do you recommend me to do as a next step after learning "Ruby on Rails"? In other words, what PATHWAY do you recommend someone to approach in applying Ruby on Rails to healthcare especially the CAD (Computer-Aided Diagnosis) systems? Thanks a lot. -- 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-t...@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] Falied to create jruby instance errror message
Hi, this is my first attempt at doing a ruby on rails project but i can't even get started, i am trying to run glassfish 3 at the moment and get this error code in the log file from #.run(C:/Users/xxx/Documents/NetBeansProjects/RailsApplication3/config/environment.rb:9) from (unknown).(unknown)(C:/Users/xxx/Documents/NetBeansProjects/RailsApplication3/config/environment.rb:31) from Kernel.require(C:/Program Files/NetBeans 6.9.1/ruby/jruby-1.5.1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31) from Kernel.require(file:/C:/Program Files/glassfish-3.0.1/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:98) from Rack::Adapter::Rails.load_application(file:/C:/Program Files/glassfish-3.0.1/glassfish/modules/grizzly-jruby.jar!/rack/adapter/rails.rb:75) from Rack::Adapter::Rails.initialize(file:/C:/Program Files/glassfish-3.0.1/glassfish/modules/grizzly-jruby.jar!/jruby/rack/rails.rb:25) from (unknown).new(file:/C:/Program Files/glassfish-3.0.1/glassfish/modules/grizzly-jruby.jar!/jruby/rack/rails.rb:25) from #.new(
[Rails] Re: cucumber stories for Ajax in rails3
.serialhex .. wrote in post #972890: >> how can we manage the cucumber stories for Ajax for rails3 > > cucumber stories? > >> You can use *selenium *or *capybara* with cucumber to handle ajax request > and javascript calls. > > selenium? capybara?? are those like spices you might put on a > cucumber? or > are they other characters in this story about cucumbers?? :P > > (honestly though i think i have alot more to learn if people are taking > statements like those quoted above seriously. if i had my mom read > those > e-mails and told her it was work she'd think i went nuts!) Time for Google. Yes, these are serious and meaningful statements. (Ruby programmers do have a penchant for making libraries with strange names...) > > hex > > On Thu, Jan 6, 2011 at 11:43 AM, Rajalakshmi velu > http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] cucumber stories for Ajax in rails3
> how can we manage the cucumber stories for Ajax for rails3 cucumber stories? > You can use *selenium *or *capybara* with cucumber to handle ajax request and javascript calls. selenium? capybara?? are those like spices you might put on a cucumber? or are they other characters in this story about cucumbers?? :P (honestly though i think i have alot more to learn if people are taking statements like those quoted above seriously. if i had my mom read those e-mails and told her it was work she'd think i went nuts!) hex On Thu, Jan 6, 2011 at 11:43 AM, Rajalakshmi velu wrote: > Hi, > > You can use *selenium *or *capybara* with cucumber to handle ajax request > and javascript calls. > > > > On Wed, Jan 5, 2011 at 3:09 PM, Mallikarjun rao < > mallikarjun...@indigenius.com> wrote: > >> how can we manage the cucumber stories for Ajax for rails3 >> >> -- >> 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-t...@googlegroups.com. >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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 with div ...
I figured something out: I don't know how Ajax works! I read elsewhere to avoid Ajax until you've built an app, and sure enough, this being my first Rails-powered site, I'm all bogged down adding a 'cool feature.' I'm reworking an existing site, adding data-driven pages, and templates and partials are totally reducing my amount of code, and it's going rather well. This Ajax tangent has gotten me way off track. New plan: finish rest of site, return to Ajax refinements later. At least I have my toggle div! Thanks again for the help -- Jon. -- 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-t...@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] RubyNation CFP and Tix Available Now!
At RubyNation, our call for presentations is open until January 28th, and we have a limited number of super early bird tickets available now. This year's RubyNation will be held April 1-2 just outside Washington, DC. We are a two-day, two-track conference featuring 27 (or so) presentations. We feature mostly Ruby topics, but anything a Ruby developers might be interested in is fair game (design, javascript, database technology, inspiration-only, whatever). You can read all about us (and learn how to submit a proposal) at www.rubynation.org or our archives at http://www.rubynation.org/archive for more information about past RubyNation conferences. Speakers get in free, free food, etc., of course, and if you submit a proposal and don't get selected you will be offered a ticket at the super early bird ticket price (even if that deadline passes before we contact you). So, no worries. We would love to hear your great proposals! The RubyNation Organizers -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] ajax history.
On Jan 6, 2011, at 12:56 PM, Mauro wrote: I've seen that railscast, I'm using chrome which support pushState. The problem is that ajax history with paginate works but if you, for example, go to a site www.google.it or whatever internet site and then push browser back button the page showed isn't an html page, but it seems a text page. Try. Watching that 'cast, it seemed to me that you could bookmark the resulting URL, and restore your search/pagination/whatever state just fine. I haven't tried the google.it page in this respect, but if the URL changes to show the unique address of the current state of the page, then that's the goal and the goal has been met. Back button or bookmark and new session, it should appear the same either way. Walter -- 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-t...@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: Forceing PUST vs. POST in form
James Byrne wrote in post #972875: > I am experimenting with a combined form. I wish to force the HTTP verb > for this form to PUT. However, it always uses POST when submitted and I > cannot determine why. Because that's the way Rails works. Many browsers don't support PUT forms, so Rails leaves the method as POST and adds a hidden field to fake what the method "really" is. Rails does the processing of that hidden field transparently, so that a POST with method "_put" will appear to the framework exactly like a real PUT. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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] Forceing PUST vs. POST in form
I am experimenting with a combined form. I wish to force the HTTP verb for this form to PUT. However, it always uses POST when submitted and I cannot determine why. The view template code is: <%=form_for( @user, :html => { :class => :edit_user_role, :id => :edit_user_role_form, :method => :put }, :url => user_roles_url( @user ) ) do |f|-%> The resulting html is: http://www.example.com/users/330/roles"; class="edit_user_role" id="edit_user_role_form" method="post"> This confuses me. The form method is not being set by the html attribute but a hidden field is being created instead. Since Rails considers only the HTTP verb for routing this simply will not work as I expect. What is the problem with my approach? How does one set the form method? -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] ajax history.
On 6 January 2011 15:52, Walter Lee Davis wrote: > On Jan 5, 2011, at 7:18 AM, Mauro wrote: > >> but it seems that the new javascript api history.pushState doesn't >> work as well as jquery.ba-bbq.js > > What are you basing this on? pushState only works in browsers that support > it, so Safari and a few other cutting-edge browsers, and nothing else, IIRC. > I would guess that jQuery does some work-arounds to support lots more > browsers, but I'm not sure if there are libraries available yet that use the > native event if available and degrade to support functions where it's not. > That would be cool. > > If you look at the latest Railscast about this (couple weeks ago?) it shows > how to make a system that degrades nicely to regular full reloads if > pushState isn't there to do the sub-page-reloads-with-history. I've seen that railscast, I'm using chrome which support pushState. The problem is that ajax history with paginate works but if you, for example, go to a site www.google.it or whatever internet site and then push browser back button the page showed isn't an html page, but it seems a text page. Try. -- 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-t...@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 make this SQL Query?
ppgeng...@prevailhs.com wrote in post #972869: > On Jan 5, 12:10pm, Marnen Laibow-Koser wrote: >> syntax, without proprietary extensions. This gives the best portability >> across databases. > > Just tacking on another suggestion to this if people are reading back > through here: if you do need literal SQL its a good idea to put it in > a configuration file with a lookup key > (i.e. :count_all_my_angry_birds); Why not just use a named scope (or the Rails 3 equivalent)? That's what I tend to do for complex queries. Granted, you don't get all the SQL in one file, but that's a *good* thing: it means you're looking at the SQL in context. I want to like your config file idea, but I think it's just reinventing stored procedures in a way that removes their remaining advantages. > that way if you switch db engines or > support multiple ones all your specific SQL is in one location that > you can ensure works for whatever different dbs you need to support. > And of course keep that file as ANSI compliant so that there are as > little changes required as possible. ...in which case your proposed solution isn't necessary anyway. :) > > \Peter Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Re: Document preview
On Jan 6, 2011, at 12:26 PM, Marnen Laibow-Koser wrote: JavaScript can *show* the preview in a nice popup or overlay, true, but I think the issue here is how do you get the preview in the first place. [...] My understanding is that the various JS preview libraries handle the preview image generation within the library. I might be wrong, though; I've never done this. JavaScript can only request an image and show it (often using some groovy effect to make it shinier); it can't process the image data and provide a thumbnail or something like that. To get that, you'd need something server-side to do the heavy lifting like Rmagick or some other image processing library, and you'd need a controller to interpret the image request, decide if the file already had been processed, do the processing and cache it if not, and then serve it. Quite a bit out of the usual realm for JS, right in the zone for Rails and one of its many add-ons. If I were building this from scratch, I'd be looking at Paperclip, because that has all the hooks for making thumbnails and resized images already baked in, plus a very nice system for extending the thumbnail process to other types of files. I've built a system that scrapes all the text out of a PDF and saves it in a column in the database so I can do "full text" search within PDF attachments. Considering I built that as part of my very first paying Rails gig, I happen to think that Paperclip is *very* accessible that way... Walter -- 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-t...@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 make this SQL Query?
On Jan 5, 12:10 pm, Marnen Laibow-Koser wrote: > Jatin Kumar wrote in post #972576: > > > But, If you are certain that you are going to use > > MySQL > > or a specific DB for an app then I guess there is no problem in going > > for > > SQL queries. > > Not quite. If I need literal SQL (which is rare), my practice is to > write it as far as possible in terms compliant with standard ANSI SQL > syntax, without proprietary extensions. This gives the best portability > across databases. Just tacking on another suggestion to this if people are reading back through here: if you do need literal SQL its a good idea to put it in a configuration file with a lookup key (i.e. :count_all_my_angry_birds); that way if you switch db engines or support multiple ones all your specific SQL is in one location that you can ensure works for whatever different dbs you need to support. And of course keep that file as ANSI compliant so that there are as little changes required as possible. \Peter -- 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-t...@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: Re: Document preview
Walter Davis wrote in post #972866: > On Jan 6, 2011, at 12:02 PM, Marnen Laibow-Koser wrote: > >>> These files are rather large and a user may want to see the first >>> page/contents before deciding to download the entire document. >>> >>> I was wondering if there were any rails/web/js solutions for this or >>> something similar... >> >> JavaScript solutions exist. Try a Web search. > > > JavaScript can *show* the preview in a nice popup or overlay, true, > but I think the issue here is how do you get the preview in the first > place. [...] My understanding is that the various JS preview libraries handle the preview image generation within the library. I might be wrong, though; I've never done this. Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Re: Document preview
Walter Davis wrote in post #972866: > On Jan 6, 2011, at 12:02 PM, Marnen Laibow-Koser wrote: > >>> These files are rather large and a user may want to see the first >>> page/contents before deciding to download the entire document. >>> >>> I was wondering if there were any rails/web/js solutions for this or >>> something similar... >> >> JavaScript solutions exist. Try a Web search. > > > JavaScript can *show* the preview in a nice popup or overlay, true, > but I think the issue here is how do you get the preview in the first > place. It sounds like the OP wants to make something like Mac OS's > QuickLook here... > > John, do you have a (hopefully) short list of document types that you > need to handle? Are you storing these files using Paperclip or > similar? I'm thinking that you could use Paperclip's Processors setup > to generate these preview files when they're uploaded, and access them > that way. But you'll need to engineer a mechanism for grabbing the > first page or whatever from each different file-type you plan to > store, along with a fall-back generic curled-page icon for those you > can't untwist. > > Walter They are a mixture of documents, mainly graphics and pdfs but maybe others. Its a system i have inherited using rails 1.2.2. Uses file column to upload the attachments. I could add a way to get a preview for new files uploaded and store with the attachment i suppose, images a straight forward to generate thumbnail. I could run a task to do the same for the existing documents or do them as and when. Im looking around the web to see whats out there but it will come down to the usual, time and money. I just posted to see what others were doing and was there anything rails specific around. thanks for your help, JB -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] Re: Document preview
On Jan 6, 2011, at 12:02 PM, Marnen Laibow-Koser wrote: These files are rather large and a user may want to see the first page/contents before deciding to download the entire document. I was wondering if there were any rails/web/js solutions for this or something similar... JavaScript solutions exist. Try a Web search. JavaScript can *show* the preview in a nice popup or overlay, true, but I think the issue here is how do you get the preview in the first place. It sounds like the OP wants to make something like Mac OS's QuickLook here... John, do you have a (hopefully) short list of document types that you need to handle? Are you storing these files using Paperclip or similar? I'm thinking that you could use Paperclip's Processors setup to generate these preview files when they're uploaded, and access them that way. But you'll need to engineer a mechanism for grabbing the first page or whatever from each different file-type you plan to store, along with a fall-back generic curled-page icon for those you can't untwist. Walter -- 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-t...@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: Document preview
Please quote when replying. John Butler wrote in post #972862: > sorry for the poor explanation. > > If you have a webpage with a list of documents, when the user clicks a > document then it will show them the first page of this document in a pop > up window or in some type of window within the web page via ajax or > something. What kind of documents? > > These files are rather large and a user may want to see the first > page/contents before deciding to download the entire document. > > I was wondering if there were any rails/web/js solutions for this or > something similar... JavaScript solutions exist. Try a Web search. > > JB Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: Document preview
sorry for the poor explanation. If you have a webpage with a list of documents, when the user clicks a document then it will show them the first page of this document in a pop up window or in some type of window within the web page via ajax or something. These files are rather large and a user may want to see the first page/contents before deciding to download the entire document. I was wondering if there were any rails/web/js solutions for this or something similar... JB -- 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-t...@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: Change Route for Controller
On Jan 6, 3:53 pm, Gambo wrote: > Hi there, > > i am very new to ror and i want to create a page which does the > following: > > The user can register(devise) and can specifiy a page name e.g. > jondoe. After this his account is send by email etc. > > Now I want to generate a page which follows the following route: > > www.mydomain.com/jondoe > > What I understood is that the ror standard routing goes /controller/ > action but of course I dont have a controller called jondoe. > > I also want to have the router for creating a user or doing something > else via urlwww.mydomain.com/user/edit > > I know this questions could be stupid but I didnt found a way to solve > this issue. Can somebody give me a hint? > Two things: You don't have to stick with the defaults, if you want action/ controller, action/id/controller, randomword/action etc.. then just go ahead. You can also have wildcards in the paths you match, which sounds like what you want The docs for ActionController::Routing (or ActionDispatch::Routing) have plenty of examples. There's also a guide on routing (http:// guides.rubyonrails.org/routing.html) Fred > 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-t...@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: Document preview
John Butler wrote in post #972859: > Hi, > > With images we can give the user the thumbnail to see if thats the image > they are interested in. Is there anything similar around where you > could give the user a preview of a file within the web page? Rails or > web specific? Uh, what? Please explain your use case a bit more clearly. In any case, this is almost certainly a JavaScript issue and will have nothing to do with Rails. > > Ive searched around but cant really find anything, > > JB Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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] Document preview
Hi, With images we can give the user the thumbnail to see if thats the image they are interested in. Is there anything similar around where you could give the user a preview of a file within the web page? Rails or web specific? Ive searched around but cant really find anything, JB -- 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-t...@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] Change Route for Controller
Hi there, i am very new to ror and i want to create a page which does the following: The user can register(devise) and can specifiy a page name e.g. jondoe. After this his account is send by email etc. Now I want to generate a page which follows the following route: www.mydomain.com/jondoe What I understood is that the ror standard routing goes /controller/ action but of course I dont have a controller called jondoe. I also want to have the router for creating a user or doing something else via url www.mydomain.com/user/edit I know this questions could be stupid but I didnt found a way to solve this issue. Can somebody give me a hint? 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-t...@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: Issue with setting up of Phusion
On Jan 6, 4:18 pm, Bhupendra wrote: > # I successfully installed passenger on my window os by running > command > > C:\ gem install passenger > > when i run command C:\ passenger-install-apache2-module > getting following error... Please help me.. Thank in advance Windows isn't supported. Fred > -- > ←[33m←[44m←[1mWelcome to the Phusion Passenger Apache 2 module > installer, v3.0.2 > .←[0m←[37m←[40m > > This installer will guide you through the entire installation process. > It > shouldn't take more than 3 minutes in total. > > Here's what you can expect from the installation process: > > ←[1m1.←[0m←[37m←[40m The Apache 2 module will be installed for you. > ←[1m2.←[0m←[37m←[40m You'll learn how to configure Apache. > ←[1m3.←[0m←[37m←[40m You'll learn how to deploy a Ruby on Rails > application. > > Don't worry if anything goes wrong. This installer will advise you on > how to > solve any problems. > > ←[1mPress Enter to continue, or Ctrl-C to abort.←[0m←[37m←[40m > > > > ←[33m←[44m←[1mChecking for required software...←[0m←[37m←[40m > > ←[0mc:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ > phusion_passenger/pl > atform_info/apache.rb:268:in `initialize': No such file or directory > - /tmp/pass > enger-platform-check-2228.c (Errno::ENOENT) > from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ > phusion_pas > senger/platform_info/apache.rb:268:in `open' > from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ > phusion_pas > senger/platform_info/apache.rb:268:in > `apr_config_needed_for_building_apache_mod > ules?' > from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ > phusion_pas > senger/platform_info.rb:92:in > `apr_config_needed_for_building_apache_modules?' > from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/bin/ > passenger-i > nstall-apache2-module:69:in `dependencies' > from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ > phusion_pas > senger/abstract_installer.rb:160:in `check_dependencies' > from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/bin/ > passenger-i > nstall-apache2-module:90:in `install!' > from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ > phusion_pas > senger/abstract_installer.rb:63:in `start' > from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/bin/ > passenger-i > nstall-apache2-module:236:in `' > from c:/Ruby192/bin/passenger-install-apache2-module:19:in > `load' > from c:/Ruby192/bin/passenger-install-apache2-module:19:in > `' > --- > --- -- 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-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Re: [Rails] cucumber stories for Ajax in rails3
Hi, You can use *selenium *or *capybara* with cucumber to handle ajax request and javascript calls. On Wed, Jan 5, 2011 at 3:09 PM, Mallikarjun rao < mallikarjun...@indigenius.com> wrote: > how can we manage the cucumber stories for Ajax for rails3 > > -- > 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-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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] Issue with setting up of Phusion
# I successfully installed passenger on my window os by running command C:\ gem install passenger when i run command C:\ passenger-install-apache2-module getting following error... Please help me.. Thank in advance -- ←[33m←[44m←[1mWelcome to the Phusion Passenger Apache 2 module installer, v3.0.2 .←[0m←[37m←[40m This installer will guide you through the entire installation process. It shouldn't take more than 3 minutes in total. Here's what you can expect from the installation process: ←[1m1.←[0m←[37m←[40m The Apache 2 module will be installed for you. ←[1m2.←[0m←[37m←[40m You'll learn how to configure Apache. ←[1m3.←[0m←[37m←[40m You'll learn how to deploy a Ruby on Rails application. Don't worry if anything goes wrong. This installer will advise you on how to solve any problems. ←[1mPress Enter to continue, or Ctrl-C to abort.←[0m←[37m←[40m ←[33m←[44m←[1mChecking for required software...←[0m←[37m←[40m ←[0mc:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ phusion_passenger/pl atform_info/apache.rb:268:in `initialize': No such file or directory - /tmp/pass enger-platform-check-2228.c (Errno::ENOENT) from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ phusion_pas senger/platform_info/apache.rb:268:in `open' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ phusion_pas senger/platform_info/apache.rb:268:in `apr_config_needed_for_building_apache_mod ules?' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ phusion_pas senger/platform_info.rb:92:in `apr_config_needed_for_building_apache_modules?' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/bin/ passenger-i nstall-apache2-module:69:in `dependencies' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ phusion_pas senger/abstract_installer.rb:160:in `check_dependencies' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/bin/ passenger-i nstall-apache2-module:90:in `install!' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/lib/ phusion_pas senger/abstract_installer.rb:63:in `start' from c:/Ruby192/lib/ruby/gems/1.9.1/gems/passenger-3.0.2/bin/ passenger-i nstall-apache2-module:236:in `' from c:/Ruby192/bin/passenger-install-apache2-module:19:in `load' from c:/Ruby192/bin/passenger-install-apache2-module:19:in `' -- -- 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-t...@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: Looking for Examples
Thuy Nhien wrote in post #972774: > Where can I find examples of Ruby codes? https://github.com/languages/Ruby -- 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-t...@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: Best Practice
Robert Pankowecki wrote in post #972837: >> ...and this is why attr_protected sucks so bad. There oughta be an easy >> way of saying "reject these attributes, but only for certain actions". >> Unfortunately, Rails doesn't, and perhaps can't, work that way, so we're >> stuck with clumsy hash merges in the controller. >> >> I wonder if a better way is possible. Hmm. > > http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html#method-i-attr_accessible > > http://railscasts.com/episodes/237-dynamic-attr-accessible > > It's much more flexible and simple system in rails 3. They fixed this in Rails 3? Squee! That's really cool. (I'm just starting to work with Rails 3, and I don't use attr_protected that often, so I hadn't found that out yet.) > > Robert pankowecki Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: find_or_create : how to know the resulting operation ?
Please quote when replying. Fabrice Fabrisss wrote in post #972838: > Thank you for your answers, > > I like the solution with the 'initialize' function but I still haven't > tried it. > > I have a counter which counts the number of new occurence I will insert > in the database, that's why I want to be able to distinguish both cases, Please explain further. I strongly suspect that there is a better way to accomplish what you're trying to do -- perhaps having the count done on the DB side would be useful. > > Sincerely, > > Fabrice Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@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: find_or_create : how to know the resulting operation ?
Thank you for your answers, I like the solution with the 'initialize' function but I still haven't tried it. I have a counter which counts the number of new occurence I will insert in the database, that's why I want to be able to distinguish both cases, Sincerely, Fabrice -- 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-t...@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: Best Practice
> ...and this is why attr_protected sucks so bad. There oughta be an easy > way of saying "reject these attributes, but only for certain actions". > Unfortunately, Rails doesn't, and perhaps can't, work that way, so we're > stuck with clumsy hash merges in the controller. > > I wonder if a better way is possible. Hmm. http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html#method-i-attr_accessible http://railscasts.com/episodes/237-dynamic-attr-accessible It's much more flexible and simple system in rails 3. Robert pankowecki -- 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-t...@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.