Ruby on Rails is an open-source web development framework written in Ruby. Ruby on Rails follows the principle of convention over configuration, freeing you from having to re-invent things to stay productive. Ruby on Rails 4.0 is now available.
0
votes
0answers
5 views
wkhtmltopdf (with pdfkit) installed on Ubuntu but not working in Rails
I've done hours of research trying to get PDFKit to work in my production environment. Everything works fine in development, and "kind of" works on my production server.
I'm running 64bit Ubuntu ...
0
votes
0answers
4 views
Having some trouble loading highcharts using backbone and rails
I've got a couple of files I'm working with trying to load a highchart. I suspect an issue with timing, but I can't pin point what the issue is. The chart appears to load sometimes but not others, and ...
0
votes
0answers
22 views
Open iPhone app from email
I have iphone app uri scheme set up as iosapp://. I try to open my ios app from my email made by devise.
<%= link_to "open", "iosapp://" %>
But the link is not clickable. If test same code in ...
0
votes
1answer
5 views
sign_in user test rspec
I'm just starting to learn testing with rspec in Rails.
I have a User model and I'm trying to write a test to sign the user in. The following works:
describe "user login" do
let(:user) { ...
0
votes
0answers
6 views
Image_tag not including full asset_host value
config/environment/development.rb
config.action_controller.asset_host = 'http://localhost:3000'
config.action_mailer.asset_host = 'http://localhost:3000'
myMailer.rb
<%= image_tag ...
0
votes
0answers
8 views
Active Record sql query not getting logged
I am facing a weird problem for sometime, wherein the active record queries are not getting logged in the terminal, or from rails console (using ActiveRecord::Base.logger = Logger.new(STDOUT)). The ...
-3
votes
3answers
24 views
Accept number of inputs based on a number given at runtime in ruby
Accept an integer n
Based on n, accept n inputs
Ex:
At runtime
n = 2
Then 2 inputs of type string should be accepted
Ex:
At runtime
n = 3
Then 3 inputs of type string should be accepted
0
votes
1answer
10 views
Google Analytic Event Not Tracking Ruby on Rails
I was wondering whether anyone could see anything wrong with the way I have setup this tracking as I have been testing it on and off for several days and it doesn't seem to want to track.
#index
...
0
votes
0answers
20 views
Id column in schema.rb
Everytimes, I have a column for my event object (event-calendar gem) in my schema.rb file
t.integer "id", :null => false
So of course, every time I want to create an event I have an error "null ...
0
votes
0answers
6 views
Renaming Rails environment from development to local
I am not very clear on how Rails knows when to use production, development, and test environments. My understanding is that development is basically the default, and when I run RSpec it specifies the ...
0
votes
3answers
11 views
Rails: ActiveRecord query regarding size of association
I'm trying to figure out how to produce a certain query, using ActiveRecord.
I have the following models
class Activity < ActiveRecord::Base
attr_accessible :limit, ...
has_many ...
1
vote
0answers
14 views
Login to Joomla admin page through a Ruby on Rails application
i have developed an application in RoR 3.2.13 In one of my models user can create "projets" with a domain attribute. The projects are Joomla websites that user has already create. The domain attribute ...
0
votes
3answers
41 views
invalid multibyte char (UTF-8) Error, Ruby
I tried to run an ruby script in rails with the command rails runner. The ruby file, looks something like this and should create new patients:
Patient.create!({:vorname => 'Josepha', :nachnahme ...
0
votes
1answer
17 views
attr_encrypted and postgresql, does it work?
Des attr_encryptor (or attr_encrypted) works with Postgresql ?
Datas are not saved, when I wrote
@object.encrypted_value
I have something but it is never saved... Or maybe I am doing something ...
0
votes
2answers
20 views
Model Association using rails3 way
I am making association like,
I have three tables.
Product, Category
p1 ----> c1(1)
p1 ----> c2(2)
p1 ----> c3(3)
p2 ----> c2(1)
p2 ----> c3(2)
p3 ...
0
votes
1answer
9 views
Omniauth with Google Oauth2 gives a loading error
just by including the gem in my Gemfile:
gem 'omniauth-google-oauth2'
I get the following error:
21:20:05 web.1 | started with pid 20590
21:20:14 web.1 | ...
0
votes
1answer
48 views
How to convert the following rails 2.3.x code to 3.2.13?
This is my ruby code for rails version 2.3.x in Rubymine. I want to convert the following code to rails 3.2.13 as this code is not supported by rails 3.2.13.
<h1>File Upload</h1>
...
0
votes
1answer
19 views
How can I change the header info of “from”? when using ActionMailer?
I'm using ActionMailer. It's working fine.
But, I've noticed that the owner is clearly stated in header of email sent.
Just like this
Received: (from ftpuser@localhost)
What is it reffered to?
...
1
vote
3answers
23 views
Why do I get “undefined method `encoding' ”?
Why do I get "undefined method `encoding' "?
How can I fix this?
Error Message
NoMethodError (undefined method `encoding' for #<Array:0x000000218f61e8>):
...
0
votes
1answer
11 views
How to keep IP trust from email companies when developping in local/test
I am using sendgrid on my Rails app that i am beginning to build.
I am in test mode, mostly doing local stuff but i send many emails to check my process or email layout.
The email I use to receive the ...
0
votes
1answer
27 views
Max occurrences of consecutive character in a string.(Ruby)
How can I find out the max occurrences of consecutive character in a string and return the result as an array in sorted order.
Example:
input = “abcccdddeee”
output = [“c”,”d”,”e”]
0
votes
2answers
18 views
Passing value from one model to another using a drop-down menu
Models:
product.rb:
class Product < ActiveRecord::Base
attr_accessible :cat_id, :id, :name
belongs_to :category
end
category.rb:
class Category < ActiveRecord::Base
attr_accessible ...
0
votes
0answers
22 views
Rspec - GET show with respond_to on specific json view
I'm trying to use Rspec-rails on my application but I fail when I try to verify the response of my request.
This is my code :
#user_controller.rb
#GET api/users/:id
def show
@user = ...
0
votes
2answers
33 views
Ruby on Rails: nested routes, :id getting nil, but it is in database
I'm not sure where to start with this problem. I have images with nested routes, example:
localhost:3000/users/1/images/3
localhost:3000/users/1/images/4
When I go into the first image (id = 3), it ...
0
votes
0answers
18 views
Rails 3.2.13 Contact Form Only Sending Subject
So I followed this wonderfully flawed tutorial:
http://matharvard.ca/posts/2011/aug/22/contact-form-in-rails-3/
...on making contact forms. It works great. The only problem is that it ONLY sends the ...
1
vote
2answers
13 views
How to reset primary key after creating table and having lots data in Rails 3
How to reset primary key (??) I wanna set my primary key to translate_str , let it be unique in the table,
But I've already create the table and have lots of date in the database.
My Brief code is at ...
0
votes
1answer
16 views
Ruby on Rails Test Email Uniqueness Inside Javascript
I am having trouble finding an efficient asynchronous method to test whether an email that a user enters is unique. I don't want to use validates within my controller because I want to present a popup ...
0
votes
1answer
13 views
Create factory for public_activity rspec
I am using the public_activity gem and I have a method which deletes an activity record when its trackable parent is deleted. As per below.
def destroy
@comment = Comment.find(params[:id])
if ...
0
votes
1answer
11 views
OpenSSL Error when Authenticating User for DocusignAPI
We are trying to use composite templates (fillable pdfs) and embedded signing using the REST API. We are using the docusign_rest gem in conjuction with our custom code to create composite templates ...
0
votes
0answers
22 views
When running a large number of RSpec tests, path variables stop working
I have a fairly large RSpec test suite (~10K tests), and they all run fine when I run just a subset of them at any one time. However, when I try to run my entire test suite, at some point after a ...