I am running a rails app locally through NetBeans which seems to be running ruby through mingw32. I'm trying to do a system call to lame, which works fine using just irb, but this particular setup can't find it!
What can I do to tell mingw/this instance of rails where lame is?
...
I am developing a Rails application which will need frequent access to public APIs, and I am not sure what is best way to put external API (SOAP/WSDL) code in Rails application, what about model thingy, how we can manage that? Any ideas, comments?
...
Hi,
I want to insert a user in the userlist only if the user object (@row) is not nil. How do I do the insert conditionally in an rjs template?
page.insert_html :bottom, :userlist,
render(:partial => "user", :locals =>
{ :user => @row, :myid => @row.id })
thanks much.
...
Hey,Everyone!
the question is that the title say! who can tell me how do this in ruby!
...
Hello,
we are making a website that takes a generated incoming link and forwards the user who is clicking on it to another website while saving a record of the action in our DB. I guess it's basically what ad-services like AdSense do.
However, what is the best way to redirect the user?
I think html-meta-tag-redirects are out of questi...
Im using the following guide for getting started with rails for ubuntu 9.10.
http://guides.rails.info/getting_started.html
I have installed both ruby and gem.
gokul@gokul-laptop:~$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
gokul@gokul-laptop:~$ gem -v
1.3.6
gokul@gokul-laptop:~$
For rails,
gokul@gokul-laptop:...
I need to unit test that an exception in raised in code like:
def test
assert_raise Timeout::Error do
Thread.new {
raise Timeout::Error
}
end
end
How to get this working?
...
I'm having trouble with and RSpec view test. I'm using nested resources and the model with a belongs_to association.
Here's what I have so far:
describe "/images/edit.html.erb" do
include ImagesHelper
before(:each) do
@image_pool = stub_model(ImagePool, :new_record => false,
:base_path => '/')
...
I am trying to cleanup my specs as they are becoming extremely repetitive.
I have the following spec
describe "Countries API" do
it "should render a country list" do
co1 = Factory(:country)
co2 = Factory(:country)
result = invoke :GetCountryList, "empty_auth"
result.should be_an_instance_of(Api::GetCount...
Hey Friends, I'm trying to implement a java "hash" function in ruby.
Here's the java side:
import java.nio.charset.Charset;
import java.security.MessageDigest;
/**
* @return most significant 8 bytes of the MD5 hash of the string, as a long
*/
protected long hash(String value) {
byte[] md5hash;
md5hash = md5Digest.digest(value.g...
Hi,
I would like to allow a person object (instanced from a Person class) to speak a language (which is a collection of public methods stored in Language module):
class Person
attr_accessor :current_language
def quit
# Unselect the current language, if any:
@current_language = nil
end
end
Suppose that languages are the...
Hey guys, new to rails, but I have found out how to create an app now through the shell but to create an app using rails appname would give me a url of http://url.com/appname/ but I want my app, to be within the route if you understand me, so it's just http://url.com/login/ or /signup or /play so on?
So does anyone have any ideas how to...
I have made a simple Rails application that allows people to comment on posts. How do I prevent that user from submitting that form over and over again? On reddit.com they only allow newer users to make new posts every ten minutes. How can I do this with my simple blog/commenting system? Any help would be greatly appreciated. Thanks for ...
I am trying to implement Rails as a Asset Management/Risk Assessment system. I have been trying to work out the best way to model this.
A picture of what I am thinking right now.
I would like to automate as much of the treating process as possible. Ideally, someone would fill in the information for a new asset, and rails would fill...
I'm trying to figure out if there is a way to include file paths in ocra and still have the application make an exe. I have it set up so that the .exe generated by ocra would sit on the same directory level as another folder. That folder is named 'Place Files Here', and the program simply performs regex commands on text files in the 'P...
Is it possible to use Ruby as a scripting language with a HTTP server ? I'd like to be able to simply put some Ruby files in a web directory and be able to execute them from my browser - just like I did with PHP.
I have absolutely nothing against frameworks such as RoR, but I was told that I should first learn Ruby and only then move o...
hey, I wanted to upgrade to rails 3.0.
i followed the link below
http://oscardelben.com/install-rails-3
everything seemed to go smooth but finally....
gokul@gokul-laptop:~/Desktop$ rails -v
Rails 2.3.5
what should I do?
...
I have created a blog application using Ruby on Rails and have just added an authentication piece and it is working nicely. I am now trying to go back through my application to adjust the code such that it only shows information that is associated with a certain user.
Currently, Users has_many :posts and Posts has_many :comments.
When...
I'm on Ubuntu, and I've done
install gem mongo
which reported
Successfully installed bson-1.0
Successfully installed mongo-1.0
2 gems installed
I've started mongod
Now I cd to the mongo gem directory and try
> ruby examples/simple.rb
and I get the error
./examples/../lib/mongo.rb:31:in `require': no such file to load -- bson (...
I want to install a ruby gem which tries to build a native extension. The gem in this case is nokogiri. If I do gem install nokogiri, the native extension dynamically links against libxml, libxslt libs. I want to statically link against those libs. How should I go about this?
...