similar to: My id's are all float?

Displaying 20 results from an estimated 30000 matches similar to: "My id's are all float?"

2006 Jul 07
5
link_to: link is missing id
I''m using a legacy table, where the unique id is not ''id'' I have a Model class like the following: class Article < ActiveRecord::Base set_primary_key "ARTICLE_ID" end however, using a link_to like the following (modified scaffolding), the link has no id value: <% for article in @articles %> <tr> <% for column in
2006 Jul 02
5
Question about setting field values for a belongs_to model
I have two tables, applicants, and skills where each applicant "has_many" skills, and each skill "belongs_to" an applicant. When I have a reference to an applicant and a (skill) id for one of their skills, I thought to update their skills by using @applicant.skills.find(id_of_skill).description = ''new description'' # even adding
2009 Apr 06
2
Converting Number into Integer in ruby
I am working with a legacy oracle database. The primary key is not defined as an integer but as a number. This results in a url with an id as a number, such as 1234.0 instead of 1234. It works fine, but I would prefer 1234 to be displayed in the url. I have attempted to redefine the model id method to convert to an integer using to_i method, but no luck. Any ideas? Thanks, Vaibhav -- Posted via
2005 Dec 30
11
Losing my mind with Ajax link_to_remote
I''m playing around with Rails, and I can''t get this to work. I just can''t seem to wrap my brain around it. I''m having some trouble doing an Ajax navigation column. Here''s what I have: view layout: <div id="navigation"> <%= render(:partial => "navigation", :collection => @categories) %> </div> My
2007 Sep 10
6
RSpec view spec writing problem (unable to generate url_for in RESTful resource link_to)
Thanks, first, to everyone who''s asked and answered questions on this list, and to the creators of RSpec - it is all very helpful. I''ve searched the mailing list, and had a couple 2hr googling sessions that didn''t help me find an answer. I''ve run into a problem getting my first non-trivial view spec to run. I get an error when trying to generate a link_to()
2006 Mar 21
5
Object#id being deprecated - Rails 1.1
Hi Think this is probably straightforward, but I don''t know enough about rails to work it out, so was wondering if anyone can help I keep on running into this error when I''m deploying my app: "FastCGI: server ".../public_html/public/dispatch.fcgi" stderr: ../config/../app/views/items/_side_share.rhtml:8: warning: Object#id will be deprecated; use
2006 Jan 30
3
general questions
Agile book lacks some basic information, perhaps I need to learn ruby as I am lacking information - some basic things - especially debugging. The following are stupid newbie questions and any portion of them answered would be great. 1. If I am viewing a page from app/views/clients/ and on this page, I want to put a ''link_to'' directive to say app/views/case_managers... how do I
2006 Nov 04
0
weird problem with content type
Hey all, My site is working ok except for a page that displays as text instead of html. I tried to use this: puts "Content-Type: text/html" then it display the page as html normally but I still get that ugly part on top of my page: Content-Type: text/html Set-Cookie: _session_id=6356b18a24d56a0da01bfab791fa911d; path=/ Status: 200 OK Cache-Control: no-cache here is the url:
2013 Mar 07
2
Puppet Dashboard changed reports view error
Hello Puppet Users ! We encounter a problem with the dashboard on this URI : /reports/changed The /reports works fine with ~130000 reports (up to 3 months and auto-cleaning with rake reports:prune job) I make a reports:prune:orphaned, juste in case, but without any success. The most recent change on the server was the puppetmaster upgrade from 3.0.2 to 3.1.0. Here is the dashboard error log
2008 Nov 19
3
Rails.cache and problem with model id?
I have the following: MODEL: def self.get_tag_cloud Rails.cache.fetch(''fetish_tag_cloud'', :expires_in => 1.hour) do find(:all, :conditions => [ "approved_for_tag_cloud = true"], :order => "LTRIM(name)") end end CONTROLLER: def index @fetishes = Fetish.get_tag_cloud end VIEW: .... <% @fetishes.each do |fetish| -%>
2009 May 28
1
[PATCH server] Change default flexchart view and increase vertical dimension of flexchart area.
--- src/app/views/graph/history_graphs.rhtml | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/views/graph/history_graphs.rhtml b/src/app/views/graph/history_graphs.rhtml index 9488367..7a7e1e1 100644 --- a/src/app/views/graph/history_graphs.rhtml +++ b/src/app/views/graph/history_graphs.rhtml @@ -7,10 +7,10 @@ $('#flex_history_chart').flash( {
2006 Jul 07
8
Possible name clash?
Scenario: Table in database has two fields, id and category (table name is: categories) Controller is named category_controller.rb Model is named category.rb Helper is named category_helper.rb Form is named list.rhtml in view\category directory The code in play on the form is (from generating scaffold): <% for category in @categories %> <tr> <td><%=
2006 Jun 07
1
Setter that converts a float attribute to integer
Hi, I have some problems with an application where I''m using custom accessors to do currency conversions. In my model, I have a price attribute in the database that stores the value in cents, to avoid future problems with float arithmetic and round. But at the views, I would like to show the price in euros, with decimal for the cents. So I defined a new attribute called price_in_euros,
2006 May 12
1
Some error about adding.
Ok so I''m trying to make a little exchange 3 for 1 of 1 higher rank here is the code in the controller: def exch_link @id = @session[:user].id @type = @params[:type] exch(@id,@type) end def exch(user_id,this_type) @user = User.find(:condtions => "id = " + user_id) @ranks =
2008 May 28
15
Help with output
I am having problems trying to get the output to work in an application I have. Here is the example THIS GIVES ME THE CORRECT VALUES <!-- ######## Flooring ######### --> <% if(params[:flooring]) %> <tr><td colspan="4"><h2>Flooring</h2></td></tr> <% for company in @companies
2006 Jun 26
5
Newbie question about Agile Rails book - Delete from cart
I have been working through the Agile Web Development with Rails book doing the Depot tutorial. I have completed it and it works but I cant say I understand how and why. My question is this "After adding products to the Cart, how do I then give users the option to delete just one item and not empty the whole cart?" I''ve been playing around with all sorts of code, just making
2006 Mar 17
1
How to update values in database in this form?
Hi, This is my rHtml page & Corresponding actions & model pages:- ===listform.rHtml================= <h1>Products List</h1> <%= start_form_tag(:action => "add_to_cart")%> <table> <tr> <% i=0 %> <th> Product No. </th> <th> Unit Price </th> <th> Available Qty. </th> <th> Demand Qty. </th>
2006 Jan 11
15
How to use custom url formats?
I''m new to Rails and am trying to use a field called "code" instead of "id" in my URLs. For example, assuming I''ve got a database of motorcycles makes where the codes are "Honda", "Yamaha", "Suzuki", and "Kawasaki", etc. To show the info about Honda I want to use this url: http://www.mysite.com/makes/honda/
2006 Jan 22
6
Destructive behavior with link_to, button_to, :post=>true
Hello- I would like to know what the suggested practice is for having multiple submit buttons on a relatively complicated input page. Let''s use the example of a Contact. There is lots of info there, including name, address, phone number. There is also a list of "contact associations" which can be modified on the same page. Ideally, the user could have one
2006 Mar 11
11
Noob needs help with ''if'' block
Hello all. I''m a noob at Ruby on Rails, only started learning a few days ago, but I''m loving it so far. I do have a few years experience with PHP, ASP, MySQL, etc., so I''m not *totally* clueless, though. :) Anyway, I''m having trouble with something that should be fairly trivial: I have an ''if'' statement that is supposed to print out a table