Ruby is an open-source dynamic object-oriented interpreted language created by Yukihiro Matsumoto (Matz) in 1993.
0
votes
1answer
11 views
Category id in forms - model associations
I have a 2 models: a product and a category model with the following association:
class Product < ActiveRecord::Base
belongs_to :category
validates :title, presence: true
end
class Category ...
0
votes
0answers
19 views
Registering all exeptions from rails app
I have in some applications a custom library that gathers sensitive information.
This information comes from various sites, like: twitter, facebook, governamental blogs, college sites and common ...
0
votes
1answer
27 views
Ruby on Rails, instead of update make new entry to model
I made a simple demo site, with an model for the patients name (name:string) and another model with the treatment (content:text). I created this "project" to learn more about the ...
0
votes
0answers
10 views
CarrierWave: Use of file name in store_dir
I'm saving images to S3 using CarrierWave. Before uploading the images are renamed to a random string. Now for faster lookups I wanted to put the files in directories named after the two first letters ...
0
votes
1answer
27 views
ruby - can't concatenate array elements into a string?
For personal homework I am trying out a digital clock program to display 'big' numbers.
A ruby program that has parts of the clock that come from strings stored in an array and then a routine (not ...
0
votes
1answer
12 views
How to map :!ruby % to a key combination in gvim?
I want to map :!ruby % to Ctrl + j in gvim, but I can't understand exactly how.
So, I know that there are different type of maps working in different modes - normal, visual, insert, etc. What I ...
0
votes
1answer
19 views
Assistance with a JSON dump in application
I was wondering if anyone could help explain a few things with what is going on in the following scenario. I am trying to grab all my Tweets using the new twitter api v.1.1. I come across this blog ...
-1
votes
2answers
43 views
Create website image programatically
When I look at social bookmarking website or web master tools, they have a screenshot of a website showing.
I would like to do the same thing.
How can I go about doing this? (I know they are not ...
0
votes
2answers
28 views
convert single quotes string to double
I have problems working with .gsub ir .delete functions on received results from the database. I guess these results comes in single quotes, so I'm getting different results:
<%= "Remove ...
0
votes
1answer
19 views
Rails - link_to a user#show
In rails how do I do a link_to a user show page of the current user. Basically i want a link that go to a account page.
I tried it but i get this.
Routing Error No route matches ...
2
votes
2answers
34 views
Removing line breaks in Ruby
I have a problem removing \n and \r tags. When I'm using double quotes, it works ok, otherwise it leaves "/". With gsub, it doesn't work without double quotes at all. Why?
<%= "Remove ...
1
vote
0answers
22 views
Devise Warden Authentication Fails First Time, Succeeds After
I am using Devise to authenticate users for my rails app using database authentication (for username and password) and token authentication for an API that I built with Grape. Devise is generating an ...
0
votes
0answers
10 views
Qt::TableView.model returns nilClass when Nokogiri is used
EDIT
The problem was with something altogether else.
OK, so the trouble wasn't really Qt. Still, I don't know why this happened.
The thing was that in the function display_filesize ...
2
votes
1answer
32 views
Get unique array of Classes
I have an array of objects:
@searches
It could return something like:
--- !ruby/object:Profile
attributes:
id: 2
name: Basti Stolzi
username: paintdat
website: ''
biography: ''
...
1
vote
1answer
25 views
How to set up the recipient id in public activity
I am going over Public Activity Gem Railscast Vid. (http://railscasts.com/episodes/406-public-activity)
My current DB looks/stores everything but the recipient_id....it shows up as nil
...