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.
1
vote
0answers
6 views
Structuring secret links in Rails 3
In a rails application I am building I have a resource called buckets.
I am now tasked with creating secret links for these buckets, for example -
...
0
votes
0answers
3 views
Prawn PDF common definitions
I'm using Prawn to generate Rails PDF documents. I have 5 different pdf generations that have quite distinct code. However, they each have some common elements such as header, footer, and company ...
0
votes
0answers
12 views
Rails: Javascript not working in Production
So far here's what I've done.
I loaded assets in the Capfile: js still not working
http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets
I moved coffee-rails from the assets to the ...
0
votes
1answer
19 views
Is it possible to copy only not protected attributes from one model to another in ROR3?
I need to copy attributes from one model to another. So I'm explicitly setting them like this:
user = current_user.attributes.slice("id", "name", "surname")
user["user_id"] = user.delete("id")
...
0
votes
1answer
15 views
How would you use a regular expression in an activerecord scope
I hoping to use a regular expression in a scope.
scope :smith, where(:full_name => /(smith)/) #names that include the word smith
Is this possible I've been trying different approaches to ...
0
votes
1answer
15 views
Filtering an ActsAsTaggableOn belongs_to association
Using ActsAsTaggableOn I'd like to create a collection of TimeFrames that belong to an event that has been tagged with 'fun'
However, I'm getting this error "SQLite3::SQLException: no such column: ...
0
votes
0answers
11 views
Carrierwave/Minimagick - Cropping is always inaccurate, except when 'y' parameter is 0
Having implemented the ability to crop as shown in the Railscasts episode 182 (revised), I can't seem to get cropping work accurately. What is cropped is always the top 20% of the area selected in ...
0
votes
2answers
28 views
Rails display simple partial?
My steps so far: Ive created an new rails app:
rails new sample
cd sample
rails g scaffold Post name:string content:string
rails g controller welcome home
Next step i added to the welcome/home ...
0
votes
0answers
11 views
How to define rails observers path in application.rb?
I just want to define my all observer in single line now i have code like this config.active_record.observers = :user_observer, :studet_observer, :suggestion_observer,
:progress_observer, ...
0
votes
1answer
35 views
Why this won't get faster?
I had this everywhere in all controllers, and views.
if current_user
transaction
end
It's probably up to 100 if statement with current_user.
So I added this this below to ...
1
vote
1answer
13 views
Rails Jquery Mobile Radio Button Form
I have been trying to get a dynamic radio button form working in my mobile (JQM) rails 3 app for about 1 week now.
Here is what I need:
Dynamic radio button selection, with JQM Control Group, radio ...
0
votes
1answer
21 views
HTML Table issue grabbing data from two database tables
Iam having an issue getting data from two different database tables to display properly with in an HTML table. I'm sure I am just overlooking something and this is pretty easy, but for whatever reason ...
0
votes
0answers
6 views
How to add background/fill color to a bounding_box in Prawn
Is it possible to add a background color to a bounding_box in Prawn?
bounding_box([100, cursor], width: 80, height: 20) do
pad_top(7) { text "THIS IS TEXT", size: 8, align: :center }
...
0
votes
1answer
8 views
how to use content_for so that the content shows up in the layout
Am testing the content_for in my rails 3.2 app and following the rails guides but they are specific to the actual files and I cannot seem to get the yield to work:
application.html.erb file:
...
-4
votes
0answers
12 views
“tests UserMailer” line in functionaltest for mailer [on hold]
I'm following tutorial for rails apps and there is line tests UserMailer in class UserMailerTest < ActionMailer::TestCase . All my tests passes with this line, without this line and with line like ...