1 2 3 4
<% if I18n.locale == :pl %> <%= link_to 'PL', { :locale => :pl }, :class => "language_selected" %> | <%= link_to 'ENG', { :locale => :en } %> <% else %> ...
Ruby Language Selection
Hi, I'm sure this is the mo...
1 2 3 4
openid_mapping = { :email => ["email", "http://axschema.org/contact/email"], :name => ["fullname", "http://axschema.org/namePerson"] ...
Ruby Hash + Array refactor
This actually works but I w...
1 2
hash = {} array.each { |key| hash[key] = func(key) }
Ruby How to make it more idiomatic?
Can you make this code more...
1 2 3 4
def include_class?(obj_class) stack = [] ...
Ruby hash.include_class?, recursive
I have a hash like this one...
1 2 3 4
# link_categories has_many links create_table "link_categories", :force => true do |t| t.string "name" ...
Ruby Find records according to r...
I have a method (LinkCatego...
1 2 3 4
require 'uri' require 'net/http' require 'net/https' ...
Ruby Ugly net/http code
I am not an expert of the n...
1 2 3 4
require 'ruby_camping' require 'camping_guests' ...
Ruby Help!! undefined method for...
Hi! Ive posted before about...
1 2 3 4
require 'guest' require 'parking_lot' ...
Ruby `initialize': wrong number ...
Hi Im getting this error wh...
1 2 3 4
def is_pos_activation? if session[:pos_activation] block_given? ? yield : true ...
Ruby better way?
i like this code, but exist...
1 2 3 4
require 'guest' require 'parking_lot' ...
Ruby undefined method for nil:Ni...
Hi!
whn i try and run my p...
1 2 3 4
puts "Please enter the sentence to be encrypted: " plaintext = gets.chomp.upcase! puts "Please enter the vigenere key: " ...
Ruby Vigenere cipher implementation
I tried implementing this b...
1 2 3 4
def name_repair(var) car_names1 = ["HONDA", ...
Ruby Can I remove the return sta...
What this method does is; I...
1 2 3 4
class Array def count_by(&block) ...
Ruby Array.group_by that counts
I want an array method that...
1 2 3 4
ls = LineStream.new(true) bl = ls.retrieve line_msg = ls.messagize(bl, false) # long format ...
Ruby Checking validity of messag...
I have an ActivityStrea...
1 2 3 4
class Plugin end ...
Ruby Ruby Plugin Architecture
I am pretty lost on this, t...
1 2 3 4
class MyFancyClass def initialize(hash) ... ...
Ruby Handling reserved word coll...
When you work with APIs tha...
1 2 3
class Store < ActiveRecord::Base has_many :promos ...
Ruby Rails Store has more than m...
Store has many Promos. Prom...
1 2 3 4
def check_win_streak(streak) badge = 10 while badge < BADGE::MAX_STREAK_BADGE_SIZE do # MAX_STREAK_BADGE_SIZE = 30 ...
Ruby how to refactor tricky logi...
The rule at work here is th...
1 2 3 4
require 'date' #Get data from user for memo ...
Ruby Simple Ruby Program for cre...
This is the first program I...
1 2 3 4
#!/usr/bin/ruby =begin ...
Ruby I'm having trouble thinking...
I'm working on Project Eule...
1 2 3 4
last_vehicle = Vehicle.find(:first, :order => 'id desc') unless last_vehicle.blank? ...
Ruby Ruby on Rails reverse 'build'
In this scenario, a new Veh...
1 2 3 4
def update rayon = Rayon.find(params[:id]) if rayon.update_attributes(params[:rayon]) ...
Ruby Ruby if/else statement
0 vote down star
...
1 2 3 4
arr = [] b={:a => "option1", :b => "option2"} b.each_pair{ |key,value| arr << "#{key}=#{value}" } ...
Ruby HTML query string
Trying to create the query ...
1 2 3 4
class TryAgain < RuntimeError; end class RetryLoop ...
Ruby Retry Loop
Here's an abstract way to r...
What would be the best or a...