Hey,
Considering models in Rails:
class Organization < ActiveRecord::Base
belongs_to :OrgType
end
Does it bother you that models in Rails don't include the fields that made the entity?
I know this is done for DRY's sake but you have to check the data base tables schema every time you want to check model's fields.
...
Is there a working client (in any language, preferably in ruby) that can currently retrieve subscriptions (starred, liked, tags are a bonus) from, still the unofficial, Google Reader API?
I've tried both this and this, but they seem unable to make simple requests, such as http://www.google.com/reader/api/0/subscription/list, which works...
Hello everyone, I am developing my Rails 3 application that uses Twitter OAuth and I am getting troubles because apparently I can't get the access_token, after clicking 'Allow' and Twitter redirecting me back to my application url, when I go to twitter.com/settings/connections I can't see my app there as authorized. I guess there is som...
I would like to debug and possibly contribute to some open source gems but am fairly new to Ruby and Rails. What is the best way to go in and start setting breakpoints, etc?
Right now I just use ruby-debug for my own code and inspect variables mostly.
...
I have a class like this:
class MyObject
cattr_accessor :value_
def +(right_)
self.value_ + right_.value_
end
end
I want to be able to do something like this:
x = MyObject.new
y = MyObject.new
x.value_ = 1
y.value_ = 2
puts x + y
It's not working though. Not the cattr_accessor as opposed to attr_accessor, not sure if t...
Is everything in ruby an object? Does this include Fixnums?
...
Is there any way I could get info such as how long did it take to connect to a remote server, time taken to receive the first byte of response, and the time taken to download the whole file?
I'm trying to create something like what Pingdom does.
...
I'm trying to create a User class that would store only hashed password
class User
# Password should be stored only as hash in @password_hash,
# crypted by that function:
def self.crypt(password)
# Returns password hash
end
# Crypt password and store it in @password_hash
def password=(str)
@password_hash = crypt(str...
Possible Duplicate:
Ruby question mark
HI
whats the '?' mean at the end of a method deceleration?
e.g
def is_it?
somthing
end
def is_it
somthin
end
...
I'm playing around with Ruby's .object_id and noticed that, in several sequential sessions of irb, I get these identical results:
false.object_id // 0
true.object_id // 2
nil.object_id // 4
100.object_id // 201
In fact, every integer's object_id seems to be ((value * 2) + 1).
On the other hand, a given string's object_id is never th...
I've never used Jruby and I don't know why I should, but some people use it to complement the missing Java features in the Ruby language.
So I wonder if Ruby will ever support the missing features Java does in the future so we do not need to learn Java?
What do you think?
...
I have the following task I want to do:
Design a base algorithm to analyse log files (please, don't question that).
Provide some options through OptionParser to allow variations in calling.
Extend the base algorithm by some other scripts that use the original ones.
Now the question: What is the best way to expand the functionality an...
I have taken over a medium sized project that was written originally using RoR. The powers that be have decided that they want the web app, 'ported' to Symfony.
After looking at some of the RoR code, I suspect that RoR strongly "influenced" Symfony, as a lot of the idioms are shared - so I think that a 'port' of an app from one to the o...
<%= will_paginate(@posts) %> # will generate the links like this '<a href="/posts?page=n">a link</a>'
# What should I do if I want to change the herf base on '/contents', etc. '<a href="/contents?page=n">a link</a> ?
# It seems that there is no options for this , help!
...
I have the following code:
<% @recipe.instructions.each do |instruction| %>
<li><%= instruction %></li>
<% end %>
I get the following error: undefined method 'each' for #<String:0xa354eb8>
@recipe.instructions is defined as text
Please help!
Reese
...
I need to generate boundary for a multi-part upload
post << "--#{BOUNDARY}\r\n"
post << "Content-Disposition: form-data; name=\"datafile\"; filename=\"#{filename}\"\r\n"
post << "Content-Type: text/plain\r\n"
post << "\r\n"
post << file
post << "\r\n--#{BOUNDARY}--\r\n"
The BOUNDARY need to be a random string (not present ...
Have several pdf webforms that I would like to auto-populate with information from my model.
Here's a sample pdf http://www.flhsmv.gov/dmv/forms/BTR/Milpak/82040.pdf
Is there a gem or plugin that could help?
...
Here is the documentation for the SugarCRM 5.5 API:
set_relationship
http://developers.sugarcrm.com/docs/PRO/5.5/Developer_Guides/-docs-Developer_Guides-Sugar_Developer_Guide_5.5.1-Chapter%202%20Application%20Framework.html#9000526
This is the gem which is creating methods for me to access it (line 110):
http://github.com/dennijo/Rub...
Hi,
I am currently running a rails app in production. Whenever i try to access my home page i get an error 500. This started happening recently so i have successfully run the app before.
I realised that i could access some of my inner pages and this problem seems to be common on pages using google maps api. So i figured it could be one...
I am putting my first rails app on the internet, I have read the rails guide on security and have implemented the points listed in there but was interested to hear of anything else ?
Also I currently store my uploads in public/documents is this ok ? I noticed there is no htaccess files protecting the directory.
...