Questions tagged [rails-3.0.10]
9 questions
3
votes
2 answers
Hash does not contain 'try' method
I am noticing differences between a hash object within Ruby 1.8.7 and a hash object within Rails 3.0.10.
For example, within the 1.8.7 irb, I get:
1.8.7 :001 > {}.try(:method)
NoMethodError: undefned method `try' for {}:Hash
from…

David Weiser
- 5,190
- 4
- 28
- 35
1
vote
1 answer
How Can I acess a attribute in a table using join_table in a model
in a app, I have the follow codes:
class UserProfile < ActiveRecord::Base
belongs_to :user
has_and_belongs_to_many :knowledge_areas, join_table: 'user_profiles_knowledge_areas', order: 'identifier'
class KnowledgeArea < ActiveRecord::Base
…

Lorena Bento
- 544
- 10
- 29
1
vote
3 answers
Passing optional parameter in JavaScript Function
Is possible to pass a optional param to a function in javascript?
I have a function in JavaScript and I want recicly, so, instead I use the var options inside the function, I want to pass the variable for param.
My function…

Lorena Bento
- 544
- 10
- 29
1
vote
1 answer
ActiveRecord::HasManyThroughSourceAssociationNotFoundError in rails 3.0.10
I have the following code
class Involvement < ActiveRecord::Base
belongs_to :matter
belongs_to :contact
end
class Contact < ActiveRecord::Base
has_many :involvements, :order => "position", :dependent => :destroy
has_many :matters,…

Sapna
- 11
- 2
0
votes
1 answer
NoMethodError (undefined method `name' for nil:NilClass)
I am trying to upload images without gem to a model called "Course Classifications", before I was using the gem "Paperclip".
Rails Version is Rails 3.0.10
When I am trying to create a "Course Classification", I get the following error:
undefined…

Nicolás
- 55
- 7
0
votes
1 answer
Ensuring genuine parameters doesn't trigger "You tried to assign already serialized content to value. This is disabled due to security issues."
I've created a form builder in rails that allows users to construct their own forms. Many of the form inputs supply straight strings back to Rails (e.g. a text field). Some provide arrays of values (like date choosers). Right now I'm storing the…

Brendon Muir
- 4,540
- 2
- 33
- 55
0
votes
0 answers
JavaScript works in development, but doesn't in production
I'm with a trouble, I have a application and some views use javascripts, I'm using the jammit gem.
I add a new javascript to sort and to filter records, the problem is, works in development, but doens't work in production.
I tried some things, for…

Lorena Bento
- 544
- 10
- 29
0
votes
0 answers
Using JQuery only a view without change my layout
I'm tryng to use a plugin called DataTable, so, I need to use JQuery in my application, but I wanna allow javascript just in one page.
So, in my folder layout, I have:
--app
---layout
-----application.html.erb
-----user_reports.html.erb
In…

Lorena Bento
- 544
- 10
- 29
0
votes
1 answer
mongo_mapper_acts_as_versioned failing when saving a Time type
I am trying to set up versioning on my mongomapper model using the https://github.com/Bramanga/mongo_mapper_acts_as_versioned gem that I forked. However, whenever I try to save my Finding model, it fails if I try to save it with a Time type (which I…

Bramanga
- 138
- 1
- 10