Hi,
I'm building an application in ruby using the sinatra framework and am having trouble with rendering some fbml elements.
I'm currently trying to render an fb:multi-friend-selector so the user can select which friends they want to invite. However, when I write the following in my code:
<fb:fbml>
<fb:request-form action="/invit...
Hi all !
I'm using the Sequel (Taps) ruby gem for a remote backup of my production database (PostgreSQL).
I wonder if storing that backup with SQLite is a good solution.
What's your feeling ?
Thx !
Edit:
Thanks! In fact, my app is hoted on Heroku and I though it was simply impossible to run pg_dump.
But -- I found that nice rake...
The following error is displayed in command prompt in Windows 7
C:\Users\rd\Desktop\Training\Problem2\sudoku\sudoku>gem install rest-client
WARNING: RubyGems 1.2+ index not found for:
http://gems.rubyforge.org/
RubyGems will revert to legacy indexes degrading performance.
ERROR: could not find gem rest-client locally or in a ...
For my rails app i want to extract the meta-tag contents of website to further processing. but for some sites which redirect to another url , i cant get hold of the final webpage easily. Is there any way in ruby to follow all the site redirections such as http redirect, meta-tag redirect, frame redirect etc. effeciently?
Thanks
...
Hi,
I have an array of two dimensional Arrays. I want to create a new two dimensional array which finds the sum of these values in the 2D arrays.
Sum at x,y of new array = Sum at x,y of arr1 + Sum at x,y of arr2 + ....
|1,2,4| |1,1,1| |1,1,1|
|2,4,6| |1,1,1| |1,1,1|
|2,4,6| |1,1,1| |1,1,1|
|2,4,6| |1,1,1| |1,1,1|
Now adding the...
Using Ruby on Rails, if I do a
gem help install
a part of it says:
-y, --include-dependencies Unconditionally install the required
dependent gems
[...]
Defaults:
--both --version '>= 0' --rdoc --ri --no-force
--no-test --install-dir c:/ruby/lib/ruby/gems/1.8
but if I do a
gem install -...
I have been using MSSQL 2005 with Rails for quite a while now, and decided to bump my gems up on one of my projects and ran into a problem.
I moved from 2.2.22 to 2.3.8 (latest as of writing) and all of a sudden I got this:
ODBC::Error: S1090 (0) [unixODBC][Driver Manager]Invalid string or buffer length
I'm using a DSN connection wit...
I have a too many models and want to maitain separate validation and
relationship files for each model in rails. Is there any way i can maintain it
with rails?
Any specific advantage to do it?
...
I am trying to write a ruby string to a file in such a way that any newline characters embedded in the string remain embedded. This is being written out to a file which will then be processed by another tool.
An example is below.
I want this: 1 [label="this is a\ntest"] \n (second \n is a true newline)
I have tried this: string = '1 [l...
I want to use Delayed::Job (or perhaps a more appropriate job queue to my problem) to dispatch jobs to multiple background daemons.
I have several background daemons that carry out different responsibilities. Each one is interested in different jobs in the queue from the Rails app. Is this possible using Delayed::Job, or perhaps there i...
I'm working my way through Pickaxe 1.9, and I'm a bit confused by constant-lookup in instance/class_eval blocks. I'm using 1.9.2.
It seems that Ruby handles constant-lookup in *_eval blocks the same way it does method-lookup:
look for a definition in receiver.singleton_class (plus mixins);
then in receiver.singleton_class.superclass (...
Greetings,
I get the feeling that I'm using ruby in an ugly way and possibly missing out on tonnes of useful features. I was wondering if anyone could point out a cleaner better way to write my code which is pasted here. The code itself simply scrapes some data from yelp and processes it into a json format. The reason I'm not using has...
I have this div
<div class='notice'>
And I want the result to be
<div class="notice error">
And Is there a way to add a class in my erb? I tried
<div class="notice #{new_class}">
But that doesn't escape into ruby code when it renders...
and ideas?
...
If I do sudo gem uninstall rails -v 3.0.0.beta3, it uninstalls rails but leaves the beta3 versions of activerecord, actionmailer, etc. How do I completely uninstall rails 3.0.0.beta3 and all its dependencies automatically? I would like a clean slate for the RC and final releases.
...
deltrem@deltrem-desktop:~/ramaze web/app/blog$ ruby start.rb
I [2010-06-10 14:53:33 $1886] INFO | : activating sequel
I [2010-06-10 14:53:33 $1886] INFO | : Installing sequel
/usr/local/lib/site_ruby/1.8/rubygems/remote_fetcher.rb:124:in `initialize': Permission denied - /home/deltrem/.gem/ruby/1.8/cache/sequel-3.9.0.gem (Errno::EACCES...
So I've got thin installed the old fashioned way:
gem install thin
I put an app on the server and installed all of its required gems via bundler:
bundle install
But, when I tried to start the app with thin start, it can't find any of the bundler-installed gems since they're not installed in the default gems directory.
My question...
For example this what I am trying to do,
def method_a(condition, params={}, &block)
if condition
method_b(params, &block)
else
yield
end
end
and I am trying to call the method like this,
method_a(#{@date > Date.today}, {:param1 => 'value1', :param2 => 'value2'}) do
end
The result is the condition is always eva...
So I'm beginning to wonder how leaky the gnome2 libraries for ruby1.8.6 are.
#!/usr/bin/env ruby
require 'gtk2'
while true
sleep 0.1
pixbuf = Gdk::PixbufLoader.new
pixbuf = nil
end
this leaks about 16kb/sec according to watch -n 1 ps -o rss -p <process id>
This is compounded if you start trying to write a chunk of large chun...
I am looking at building something around anemone but am wary that it will use a lot of my servers bandwidth. Am I right in guessing that anemone spiders from the server it lives on and not the client side that runs it? If that is true, is there a way I can get anemone (or any other ruby spider) to run client side?
Thanks
...
In the web I've seen examples both with
<% if @showIt -%>
some html content
<% end -%>
and without
<% if @showIt %>
some html content
<% end %>
dash. Both versions work very well. So, what difference does it make?
Thanks!
...