how to change the object_id while adding row dynamically using jquery
eg:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("#addPerson").click(function(){
$("#user tr:last ").after("<%= escape_javascript(render :partial => 'user_new', :locals =>{:user_new => User.new}) %>");
re...
We are at the start of a project to test a new web application written in jQuery and are planning to do it using WATIR and FireWATIR.
During the proof of concepts test I've discovered differences in how WATIR and FireWATIR represent URLs, for example a script which passes in FireWATIR generates this error in WATIR.
assert_equal(expandI...
In one of the Eclipse-based editors that I tried out recently (I think it was RubyMine), when a Ruby keyword that either opened or closed a method or block was selected, the corresponding open/close keyword was highlighted. Similar to the way that Vim is able to highlight a corresponding open/close parenthesis.
For instance, if I select...
Is there a sane way to create and destroy multiple OpenGL windows in ruby-opengl?
I have code that is working wonderfully using GLUT, that comes with the ruby-opengl package, but it seems to suffer from the (well known?) problem of GLUT not allowing you to trap the window close events without major hacking of the library.
Some googling...
Hi
I have a method which parses a string in to a date, but i want to validate that i don't try to parse a non numeric string or a string which dosent represent a date or time format?
how can id o this?
at the moment i have:
if(string=~ /^\D*$/ )
{
return false
else
do something_else
}
this was fine for a non numeric string like "...
What's the meaning of ~> version requirement in gem specs?
hanna-0.1.12 depends on [haml (~> 2.2.8)]
...
Do you know any well documented library for handling Jabber's Jingle (audio/video) extension in Ruby ?
...
Hi,
I have a Continuous Integration / Continuous Deployment scenario where I want my build script to push a ruby gem directly from a public Build Server (teamcity.codebetter.com) to RubyGems.org.
The problem is: How can I specify my credentials?
On my local machine I have them under ~/.gem/credentials and everything works fine but how...
Is it possible from within a rake task to get a list of tasks in a namespace? A sort of programatic 'rake -T db' ?
...
i have an open source ruby project on github, where my master branch represents what has been released, and my dev branch represents what will be released next.
the master branch is ~ 80+ commits behind the dev branch, and the dev branch contains fairly significant architectural changes.
a contributor has sent me a pull request for cha...
I have 2 classes whose object should act as "partners". The first one is my Thing class, whose instances should act as Tree::TreeNodes of the gem RubyTree.
Basically, this delegation can be implemented using Forwardable:
class Thing < NoClassInheritancePlease
extend Forwardable
def initialize(title = "node")
@node = Tree::Tree...
Hi,
I am using an api that has a list of images that I would like to save to my own server. Does anyone have any suggestions on what are the best ways of doing this? or what lib's I should be looking to use?
Thanks,
Ian
...
Possible Duplicate:
`-': nil cant be coerced into Fixnum (TypeError)
Does anyone know how come guest.arrived can be nil?! This is a small part of my checkout method I have in my program. The error points at line 91 in the code which is the last part of this block of code:
departureDate = gets.chomp.to_i
guest.departure = de...
I've been looking all over the place for a simple input validation library for Ruby. Everything seems to point towards ActiveRecord (or similar). I'm not using Rails, I'm using Sinatra without an ORM. What's the best approach for validating user input (without tying directly to the model layer)? Simple things like "string length", "is nu...
i've got a module that wants to use data provided by the class that included it - but at the class level, not the instance level.
the goal is to have class 'metadata' provided to a module that the class includes, so that the module can use the metadata during the included call.
this works:
module Bar
def value
@value
end
de...
i've got a module and a class that includes the module. these are not defined in the same file, or in the same folder. i want the module to get the directory that the class is defined in.
# ./modules/foo.rb
module Foo
def self.included(obj)
obj_dirname = # ??? what goes here?
puts "the class that included Foo was defined in th...
Ruby's safe mode disallows the use of tainted data by potentially dangerous operations. It varies in levels, 0 being disabled, and then 1-4 for levels of security. What vulnerabilities are possible when safe mode is enabled? Do you know of any CVE numbers issued to a ruby program when safe mode is enabled? What CWE Violations (or cw...
If I have two migrations, mig1 and mig2, I run rake db:migrate, then I go back to mig1 and change the default value of a column, will this change be reflected when I run rake db:migrate again? Or do I have to make a new migration just for that column to make the change?
...
I have an issue dealing with a hash of objects. My hashes are player names, and the object has a property @name also.
I am trying to iterate over multiple players, and be able to use their methods and such with rather clean code. Here is how I create the hash:
puts "Who all is playing?"
gets.split.each do |p|
players[p] = Player.ne...
I have the following array:
response = [{"label"=>"cat", "name"=>"kitty", "id"=>189955}, {"label" => "dog", "name"=>"rex", "id" => 550081}]
How do I select the hash that contains the label cat? I know response.first will give me the same result, but I want to search the by label.
Thanks!
Deb
...