Hi
How can I use yield for template inheritance in erb? I want to use erb in a plain ruby CGI script and want to use a base template and subtemplate like it Rails with the application template does.
I've been using a text editor for my rails app for a while and I have a workflow that I am happy with for my existing app.
However, I am about to be starting a new app and it appears that Aptana RadRails is sufficiently developed and stable enough for use. (The last time I tried it it was in beta and wasn't quite fully baked.)
So my question is: Is it widely used in the community? What are peoples general thoughts on it?
Hi, I'm using the latest rails 3 beta. The app works fine in development mode, but when I start the server in production mode via rails server -e production, it seems that the public folder can't be found. I get error messages like:
ActionController::RoutingError (No route matches "/javascripts/jquery.js"):
And similar messages for everything that should be in the public folder.
I've tried this with both mongrel and webrick. I'd appreciate any help.
I have installed the gem 'simple_uuid' but nothing seems to be working.
Using irb and running the following:
require 'rubygems'
require 'simple_uuid'
is fine, both return true. But running the following:
// Class added by simple_uuid
UUID.new
returns
NameError: uninitialized constant UUID
from (irb):3
from :0
I'm a ruby newbie, so don't assume much in the answers. Thanks.
Hi all, I've tried to create simple facebook app with iFrame,, but I always get nested iFrame on every I click link on my application, I already tried a solution from site http://railsrant.com/2009/10/14/creating-a-facebook-iframe-app-using-ruby-on-rails-facebooker/
it's work on Firefox and Chrome, but doesn't work at IE
Any idea or suggestion for this?
Thanks
I'm following this rdoc: http://rdoc.info/projects/ncr/background-fu
and can't run ./script/generate background after installing background-fu as a Rails plugin: ./script/plugin install git://github.com/ncr/background-fu.git
I'm getting following error:
Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- job (MissingSourceFile)
Am I missing something?
I was wondering what's the point of using Ruby (or even Python) in Cocoa application development other that not learning Objective-C (which is pretty simple language and will not take to more than few days to learn). I'm new to this and I'm interested why people do this? What are Pros and Cons.
I would love to use google document viewer, but I am dealing with sensitive documents and google's Terms state that if you use their service the document basically becomes public domain.
Are they any alternatives that will keep your content private?
FYI: I am developing with rubyon rails, it would be cool if there was a gem.
Hi,
I have just started learning Rubyon Rails.
I happened to look for prevention of DNS attacks in Rails and ended up reading about DNS, Session fixation and Cross Site request forgery in Rails?
How do you prevent all the above three attacks??
Could you suggest me a good tutorial on how to deal with attack in RoR?
Looking forward for your help
Thanks in advance
Regards,
Gautam
This is the first time I'm creating an app using Rubyon Rails.
I would like to switch the database depending on the site which is loaded. With php I used to do a simple strpos on http host, and set the database name depending on that. How can I do this with rails?
Okay this has been lingering in my head for quite a while now.
In rubyon rails unit testing there is an exclamation mark with the assert method. Here is an example
test "No empty values to be inserted" do
product = Produce.new
assert !product.save
end
Let me know the function of the exclamation mark. Quick replies appreciated. Thanks.
I have a ruby array that looks something like this:
my_array = ['mushroom', 'beef', 'fish', 'chicken', 'tofu', 'lamb']
I want to sort the array so that 'chicken' and 'beef' are the first two items, then the remaining items are sorted alphabetically. How would I go about doing this?
Having sorted the tag_counts hash via the following code:
sorted_tags = Contact.tag_counts.sort{ |x,y| x.name.downcase <= y.name.downcase }
what is the easiest/most efficient way to display the tags in my view grouped by letters?
i.e
A - "Alpha", "Apple", "Aza"
B - "Beta", "Bonkers"
.
.
.
Z - "Zeta", "Zimmer"
Any ideas?
Is there any command either in debugger or ruby-debug to get a list of all gems and/or plugins loaded in memory for a Rails process? I understand only the 'require' gems are loaded but I would like to quickly see what got loaded during runtime.
I created a form with scaffold that includes two datetime fields.
I replaced them with a datepicker, and now I'm trying to grab the date from within the controller.
Instead of having ruby do all the magic work with the datefields, I instead just have to fields, start_date and stop_date that I want to use, but I can't figure out how to grab them from within my controller. Hints?
Thanks!
Now , I execute the command line "rake db:migrate" on the window OS, but I got the problem in the console. it print couldn't find HOME environment -- expanding~/.ruby-uuid'`
who can help me to solve this ? Thank you and best regards!
Are there any examples on the web of how to monitor delayed_job with Monit?
Everything I can find uses God, but I refuse to use God since long running processes in Ruby generally suck. (The most current post in the God mailing list? God Memory Usage Grows Steadily.)
Update: delayed_job now comes with a sample monit config based on this question.
Hello guys, I'm trying to add some online tests to my site and before I rolled up my sleeves I was wondering if there is any rubyon rails plugin support for such a task.
Essentially I'm looking for something that lets me add multiple choice questions. Performing the scoring logic would be an added bonus.
Any one know of anything?
We need to import large amount of data(about 5 millions records) to the postgresql db under rails application.
Data will be provided in xml format with images inside it encoded with Base64.
Estimated size of the xml file is 40GB.
What xml parser can handle such amount of data in ruby?
Thanks.
Suppose a service written with RoR starts to use AWS S3 to store some data. What is the best library to use for working with AWS S3? Currently the main two alternatives for me are:
RightScale AWS Ruby gems
http://github.com/rightscale/right_aws
AWS::s3 http://amazon.rubyforge.org/
What are their main advantages and disadvantages? What if later service will need to use other AWS (like EC2)? What other gems do you use and why?
Thanks!
Hi!
I have got model Team and I've got (i.e.) team = Team.first :offset => 20. Now I need to get number of position of my team in db table.
I can do it in ruby:
Team.all.index team #=> 20
But I am sure that I can write it on SQL and it will be less expensive for me with big tables.
What is your experience using Rubyon Rails on Heroku in production mode?
Apart of the issue of the expensive https, do you see any drawback in the way it manages processes, memory and storage?
The people at Heroku is quite nice and I'm sure they are willing to answer my questions, but I would like some opinions in the customer side.
I'd like to implement measurement unit preferences in a Rubyon Rails app.
For instance, the user should be able to select between displaying distances in miles or in kilometers. And, obviously, not only displaying, but entering values, too.
I suppose all values should be stored in one global measurement system to simplify calculations.
Are there any drop-in solutions for this? Or should I maybe write my own?