Tagged Questions
0
votes
0answers
26 views
Partial variables availiable only through local_assigns
I'm trying to pass parameters to a partial view from another partial view
_discussion.html.erb
<%= render :partial => 'text_posts/show', :locals =>{:post => post.specific, :receiver ...
0
votes
0answers
28 views
Distance calculation using Geocoder
Is there any way to get distance as a virtual attribute in a rails query?
currently i am using this :
users = User.find_by_sql("select u.*,((6371 * 2 * asin(sqrt(pow(sin(((latitude - ...
0
votes
0answers
11 views
How to destroy my sessions using devise logout in rails 3?
I am using rails 3 devise and i have created some HTML 5 web storages. Now, If user click on logout link I want to display a confirm message. And if user click on ok button i want to set my ...
0
votes
1answer
33 views
undefined method `original_filename' for Upload
Can't seem to identify why I would be getting a undefined method original_filename, trying to do a file upload that checks the file extensions. Any ideas where im going wrong here
class ...
0
votes
1answer
34 views
Why is my multiple-select with selected not working?
I am trying to use a multiple-selection drop-down but I am unable to figure out why it is not working.
<%= select( map1[:field_name], "id", map1[:field_codes], :multiple => "true", :selected ...
0
votes
0answers
15 views
'Add to Cart' button fails using 'Display: inline' in in Agile Web Development with Rails (4th edition)
I cannot make my 'Add to Cart' button inline next to the product price, for some reason that I do not understand, the button appears below the product price.
Here my development settings:
ruby ...
0
votes
2answers
32 views
Get unique values by ID rails
This is how I am showing the records of orders:
<% @orders.uniq.each do |order| %>
<% @count += 1 %>
<tr class="even border_text">
<td ...
0
votes
1answer
26 views
Delayed_job does nothing : TypeError: can't convert nil into String
Follow delayed_job from "https://github.com/collectiveidea/delayed_job". May I know why my delayed_job does nothing? I ran "rake jobs:work" ad got these errors
Error:
...
0
votes
2answers
24 views
Rails Change record values
I have a record in postgresql of user status it is boolean and its attributes are "true" and "false". I want to show "true" as "active and "false" as "inactive". How do I do it with query or any thing ...
0
votes
0answers
8 views
Custom validation on nested attributes
I need to find a way to get rails (3.2.8) to save nested attributes before performing validation on the parent object. I've searched a long time for an answer to my problem and, while I've found ...
2
votes
2answers
27 views
find where column could have multiple values, rails
I'm trying to search where one column could equal one value and the other could have multiple values...
This works, with one value for each...
<%= Post.where("category LIKE ? OR commentary ...
2
votes
1answer
48 views
How do I extract all values of a given attribute and put them into an array?
I have a Ruby object that looks like this:
- !ruby/object:Foo
attributes:
updated: 2013-07-30 13:30:21.589221000 Z
bar: 3
- !ruby/object:Statistic
attributes:
updated: 2013-07-30 ...
0
votes
2answers
53 views
setting selected to nil with select tag in ruby on rails
Hi I am trying to set ":selected => nil" or to a value from a variable like ":selected => val" in the select() in ruby but it is not working in either ways. Please can anyone tell what is wrong ...
-1
votes
0answers
35 views
How to m to m mapping search query rails?
I have tables:
desc genres_videos;
has_and_belongs_to_many :videos, :conditions => ["`videos`.deleted_at is null"]
+----------+---------+------+-----+---------+-------+
| Field | Type ...
1
vote
2answers
40 views
Rails test database not properly prepared
I have strange problem with properly preparing test database in Rails3.
In schema.rb I have:
create_table "sites", :force => true do |t|
t.string "ldap_dn", :null => false
t.string ...