Displaying 20 results from an estimated 3000 matches similar to: "id of last element in a table"
2006 Jun 21
5
newbie - question on radio_buttons
I have a view with a form and i want to be able to process the button
selected in a controller - not sure how to do this. The form does not
map directly to a model - all I want to do is be able to pass back the
selected button and know which one it is.
So, i have a form and several radio buttons - the submit (not shown)
takes me to the process_answer action where I want to determine which
2005 Dec 26
3
data insertion in multiple tables
I have two tables like:
Table A:
id (autoincrement)
name
Table B
id
id_of_A
desc
I want to add a record to table A and based on the id of A, I want to add a
record to table B.
I don''t think there is any SQL command that support this (at least in MySQL
4.1, so I use LAST_INSERT_ID()).
(Is there any other way? or MySQL 5 support any special SQL command?)
But I need
2006 Jul 27
2
setting initial text field values in a form
Hi,
I am trying to create a basic form in which I want one of the fields
initialized before displaying it.
My code (in a view) is as follows:
<%
if ( session[:user_id] != nil )
then
logged_in_user = User.find(session[:user_id])
end
%>
<% form_for :suggestion do |form| %>
<label for="suggestion_title">Topic:</label><br/>
<%=
2006 Feb 17
7
Create and then show
I am attempting to redirect to the show method after creating a new
object. So, for example, once a new post is created the user is
presented with the new post in a show view. The problem is I can''t get
the correct <at> post.id to send to the show method. Rails always
returns 0 for this value.
Here''s what I have so far:
class ContentController < ApplicationController
2006 Jul 07
2
disabling a layout before calling javascript window.open
Hi,
I have some code in which i open a pop up when a user clicks on a link.
However, the new popup window comes with the layout of the page on which
the user clicked the link. I would like to remove the layout only from
the new window which is created with the javascript window.open - any
ideas
thanks
--
Posted via http://www.ruby-forum.com/.
2006 Jun 13
13
Pass infomation between different views and controllers
Hi, I am a rails and ruby nuby :-)
How do you pass data between different controllers and views? I have a
page ( a quote) that I am editing url ....quote/edit/6 6 id the
current id. I then go to a catalog (url....catalog) to add an item to
my quote (I do this via a line_item file that the quote reads) I now
want to go back to the quote. I have tried this
<%= link_to ''Back to
2009 Sep 07
11
autoincrement for non-id column
There is a table:
execute (<<-SQL)
CREATE TABLE "tasks" (
"id" serial primary key,
"number" serial,
"version" integer DEFAULT 0 NOT NULL,
"latest_version" boolean DEFAULT ''t'' NOT NULL,
"hidden" boolean DEFAULT ''f'' NOT NULL,
"type" character varying (1) NOT
2010 Nov 26
1
R Tools & Vista_x64: Problem compiling RMySQL?
Hello:
What do I need to do to compile R packages (especially RMySQL) for
the 64-bit version of R 2.12.0 under Vista_x64?
I upgraded to "Rtools212.exe" yesterday but immediately got errors
from "R CMD check RMySQL_0.7-5.tar.gz". After the first error, I
installed it a second time, then got "undefined reference to" roughly 50
different names beginning
2005 Oct 24
3
bogus find_all in Rails 0.14.1
I have the following statement
cl = ChatEvent.find_all("ev_type <> #{t} and chat_id = #{@params
[:chat_id]} order by created_at")
which produces the following error:
#42000You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near ''order by created_at)'' at line 1: SELECT * FROM
2011 Aug 29
32
Weird assignment problem, very confused :(
Hey, I have the following line in my controller:
User.create(:email => "fuuu-+RB1Aph5k6s@public.gmane.org", :password =>
''asldfkjadsfadsf'', :ip => request.remote_ip)
my IP is 127.0.0.1 - now User.find_by_ip(''127.0.0.1'') returns 0
records although User.first contains ''127.0.0.1''
if I change it to:
User.create(:email =>
2011 Apr 25
30
NoMethodError in Book
I got a following error.
NoMethodError in Book#new
Showing /home/amrit/boook/app/views/book/_form.html.erb where line #1
raised:
undefined method `model_name'' for NilClass:Class
The content of _form.html.erb file are:
<%= form_for(@post) do |f| %>
<% if @post.errors.any? %>
<div id="error_explanation">
<h2><%=
2009 Aug 15
10
** PLEASE HELP A NEWBIE ** Status: 500 Internal Server Error no such file to load -- mysql
Hello All,
I have managed to upgrade ruby to 1.8.7.
However, when I use Terminal and ''cd'' to the app and run ''ruby script/
server'' ... I get an error when i click the link ''about your
applications environment''.
When I look into Terminal, it suggests Status: 500 Internal Server
Error
no such file to load -- mysql
How do I overcome this?
2006 Jun 22
4
Filter on variable
Hi all,
I have a question about filtering on a variable.
If I have the following code in my controller to select a list of
users
> @allusers = User.find(:all,
> :conditions => [''team_id = ?'', @params["id"],
> :order => ''created_at'')
Is there an easy way to find out all users who
2006 Jan 10
5
Select Tag and Associations
Hi there,
I''ve been working on this for awhile and have finally decided to ask
for a little guidance.I have a slight problem trying to save a
selection.
I have two models:
A "Posting" has_many "Categories", and a "Category" belongs_to one
"Posting". With that said, in the posting model I have "has_many
:categories" and within the
2005 May 17
2
Noob - ActionView::Helpers::FormOptionsHelper::select
Hi,
I''m just starting with Rails and i''m trying to do something like this:
<%= start_form_tag :action => ''add_user'', :id => @social_event_group %>
<%= select ''user'', ''id'' , User.find_all.collect {|u| [ u.login, u.id ]
}%></p>
<%= submit_tag "Add User" %>
<%= end_form_tag %>
2006 Mar 01
5
Error installing the MySQL Ruby bindings?
Hi, I attempted to install the MySQL Ruby bindings and I received the
following errors:
> gem install mysql -- --with-mysql-dir=/usr/local/mysql
Attempting local installation of ''mysql''
Local gem file not found: mysql*.gem
Attempting remote installation of ''mysql''
Building native extensions. This could take a while...
*** extconf.rb failed ***
Could not
2006 Apr 27
7
SuperImage plugin
Greetings all,
This is the first release of the SuperImage plugin. The idea is you
upload images to the database, and then pull them out at any size you
want. Combine this with caching and it will stay light and fast.
More info and instructions are here:
http://beautifulpixel.textdriven.com/articles/2006/04/27/superimage-plugin-making-resizeable-uploaded-images-easy
svn:
2012 Nov 12
3
Unable to lauch php-script to truncate database
Dear All,
we have some Nubuilder databases on a Centos6.3 server:
[root at caw-server2 db]# ls /var/www/html/nubuilder/db
reg_begeleidingsteam reg_jww_archief reg_personeel reg_straathoekwerk
reg_bib reg_jww_dossiers reg_resident reg_vrijwilligers
reg_drughulp reg_jww_dvd reg_signaleren
reg_jac_activiteit reg_onthaal reg_sollicitatie
in each
2006 Apr 30
3
Problem(?) updating gems - mysql gem
Hi,
On OS X (10.4.6), Rails 1.1.2...
I tried doing a sudo gem update, and this is the result I''m getting:
Upgrading installed gems...
Attempting remote upgrade of mysql
Attempting remote installation of ''mysql''
Select which gem to install for your platform (powerpc-darwin8.6.0)
1. mysql 2.7.2006.04.21 (mswin32)
2. mysql 2.7 (ruby)
3. mysql 2.6 (ruby)
4. mysql
2008 Jul 17
1
child xxxxx (imap) returned error 83 (Out of memory)
Hi list,
> Jul 17 12:15:10 seamus dovecot: IMAP(someone at somehost.org): block_alloc(): Out of memory
> Jul 17 12:15:10 seamus dovecot: child 26181 (imap) returned error 83 (Out of memory)
I found those two entries in the logs this morning. The system has
ample free memory. What's going on?
--
martin | http://madduck.net/ | http://two.sentenc.es/
"i wish i hadn't slept