For some reason the code I have included below does not interpolate the variables into the template. It simply copies the file over verbatim. I cannot figure out why.
https://gist.github.com/60484f7b57b06b6eb3e3
The Rails version is 2.3.4.
Thanks in advance!
...
Hi,
my ruby environment in my mac Leopard is all messed up. And I want to uninstall the entire ruby, gem stack and install them again from scratch. How can I do it ?please point me towards a good resource on the net.
thanks
...
I have made a C Ruby extension on windows using microsoft visual c++ 2008 express, and put the .dll I compiled into the diectory ruby loads extensions from and required it, and it said the file couldn't be found. I read somewhere that ruby 1.9 doesn't load extensions from dlls; only so's. Is this true, or did I forget to do something?
...
We are learning chef-solo and need a good example for better understanding.. Have searched a lot on net but the ideas are very confusing. can anyone suggest some examples.. and also how to run them.. We have installed chef-0.8.16 gem but couldnt figure out how to work with it.. We are using windows platform..Its urgent..
...
Hi,
On my current project, custom http header variable need to be set while redirecting for http basic auth.
Can I instruct redirect_to for custom headers ?
Thanks.
...
I have a model Book with attributes id, name, price. I have an instance of Book:
b1 = Book.new
b1.name = "Blah"
b1.price = 12.5
b1.save
I would like to copy b1, create another instance of the Product model. I'm tryid p1=b1.clone then p1.save but it didn't work. Any idea?
And my environment is:
Netbeans 6.9 RC2
JRuby 1.5.0
EDITED:...
Hi everybody!
Just installed Rails 3.0 beta 3 in Windows 7.
And started playing with some easy examples
class SignupController < ApplicationController
def index
@user = User.new(params[:user])
if method.post? and @user.save
redirect_to :root
end
end
end
class User
def initialize(p...
Hi!
I am using external Users database for different projects.
Now I have got School model in my project, which has_many users and users has many schools.
class User < ActiveRecord::Base
establish_connection "#{RAILS_ENV}_tunnel"
has_many :memberships
has_many :schools, :through => :memberships
end
class School < ActiveRecord::...
Right now I'm building a project management app in rails, here is some background info:
Right now i have 2 models, one is User and the other one is Client. Clients and Users have a one-to-one relationship (client -> has_one and user -> belongs_to which means that the foreign key it's in the users table)
So what I'm trying to do it's on...
In my code, I have a section that extracts and lists the different categories of posts but my problem is how to get exactly the posts that fall within that category and list them only. This is an example of my code:
category = Array.new
docs.elements.each("*/entry/category") { |element|
category << element.attributes['term']}
title = ...
I need to have a list with id's for each list item being #one, #two etc.
Is this the most efficient way or am I missing an in built ruby function here?
-num_array = ["one", "two", "three", "four", "five", "six", "seven"]
-navigation[:primary_level].each_with_index do |primary_item, idx|
%li{ :id => "#{num_array[idx]}"}
...
I have a partial view called '_comment.erb', and it may be called by parent many times(e.g. in a loop). The '_comment.erb' looks like:
<script>
function aaa() {}
</script>
<%= comment.content %>
<%=link_to_function 'Do', 'aaa()' %>
You can see if the '_comment.erb' be called many times, that the javascript function 'aaa' will be re-d...
I'm working on a SAML gateway using Ruby/Rails and I'm attempting to write some code that validates the xml digital signature of the incoming SAML response against the x509 cert of the originating service.
My problem: the signature depends on a canonicalized version of the XML that is hashed and then signed and I'm having trouble findin...
I am getting an EOFError (End Of File Error) on this code in my controller. The block where the error appears is at the end of the line that says UserMailer.deliver_message( I am unaware as to how to fix this, I have been stuck for about 2 months and this site was suggested. Please help.
def contact
@title= "Contact Us"
...
Ok here's my problem in a nutshell I've built a web service from ruby on rails. I'm using restful_authentication to create and run the login but I'm also building an iPhone application to access my web service but I can't quite figure it out. I was wondering if anyone could help me figure out a place to begin.
...
I need to run a set of tests against the same ruby version and same gemset but with different versions of a .so library.
Therefor I need to have two ruby installations (for the same version 1.8.7), each one pointing to a different set of .so files. How can I do that?
Gemset usage is already too late because library binding is done when...
Hello,
Hoping to get some feedback from someone more experienced here. I haven't dealt with the dreaded floating-point calculation before...
Is my understanding correct that with Ruby BigDecimal types (even with varying precision and scale lengths) should calculate accurately or should I anticipate floating point shenanigans?
All my va...
Hi all; I've multiply heard Ruby touted for its super spectacular meta-programming capabilities, and I was wondering if anyone could help me get started with this problem.
I have a class that works as an "archive" of sorts, with internal methods that process and output data based on an input. However, the items in the archive in the cl...
Hey Guys,
How would I save JSON outputed by an URL to a file?
e.g from the Twitter search API (this http://search.twitter.com/search.json?q=hi)
Language isn't important.
Thanks!
edit // How would I then append further updates to EOF?
edit 2// Great answers guys really, but I accepted the one I thought was the most elegant. Thanks!...
hi all
I have a ruby / rails application that integrates in and outgoing email directly into the app. The app is going to be running on multiple domains each with posible many users sending and recieving email.
I have looked into sendgrid, mailchimp and mad mimi as hosted services and also looked to create my own email server.
There ...