Displaying 20 results from an estimated 2000 matches similar to: "missing foreign key fields in scaffold views"
2005 Dec 31
7
Application Errors w/ layout & custom view pages
1) I get Rails Application Error when trying to use layout
test_controller
def list
layout "stdlayout"
end
in the views/test/layouts stdlayout.rhtml
<html>
<head><title>test</title></head>
</body>
<h1>Test</h1>
<%= content_for_layout %>
</body>
</html>
2) I get Rails Application Error when trying to use a separate
2009 Oct 05
2
gnu --target-dir, how to fake with rsync?
Is this in rsync and I just can't find it, or if not, is there a way
to fake this OR, third possibility, is anyone working to add it?
For those who've never used this option - for the GNU cp & mv type
commands they have the
--target-dir="dir"
option. It lets you put the destination directory as the first
argument to cp and mv instead of the last argument.
They added the
2010 Jul 09
1
KLdiv produces NA. Why?
I am trying to calculate a Kullback-Leibler divergence from two
vectors with integers but get NA as a result when trying to calulate
the measure. Why?
x <- cbind(stuff$X, morestuff$X)
x[1:5,]
[,1] [,2]
[1,] 293 938
[2,] 293 942
[3,] 297 949
[4,] 290 956
[5,] 294 959
KLdiv(x)
[,1] [,2]
[1,] 0 NA
[2,] NA 0
Best,
Ralf
2012 Jun 17
1
[LLVMdev] Adding code after compilation
Hi,
I want to be able add a function to a module after it is (partly) compiled in JIT. Let's say we have these functions:
Foo()
{
Stuff;
}
Bar()
{
Foo();
MoreStuff;
}
I want to have a module with Foo optimized and have a callable pointer to Foo. Later, I want to generate Bar, optimize it (so Foo is inlined) and than get a callable pointer to Bar.
Is this possible?
If so, is there a way to
2008 Jul 01
6
validates_associated & foreign keys
Hi,
I''m struggling to get the validates_associated to work as I think it
should be.
I''m using:
JRuby 1.1
rails-2.0.2
activerecord-2.0.2
activerecord-jdbc-adapter-0.8.2
My tables in MySQL:
CREATE TABLE area_codes (
id INT UNSIGNED auto_increment primary key
...
);
CREATE TABLE markets (
id INT UNSIGNED auto_increment primary key,
...
);
CREATE TABLE
2006 Mar 30
5
Heeelp - no idea what''s going wrong.
I''m working on a simple CMS. The main data type are "listings" a listing
habtm (has_and_belongs_to_many) categories and subcategories.
Subcategories belong_to categories. Subcategories are basically the same
as categories, but they are treated differently in a few situations.
The problem is, I can''t seem to write the view/controller/model code
that allows me to
2005 Dec 16
10
''Code table'' best practices?
I''ve been going back and forth about this kind of thing for a while.
I reverse my opinion on it every project, and I''m wondering if anyone
has any advice/battle scars to share. As usual, please forgive my
long-windedness in advance.
Let''s say I have this:
Table: PLANS
ID int
CATEGORY_CODE_ID int
--Other junk removed for clarity
Table: CATEGORY_CODES
ID int
DESCRIPTION
2006 Apr 15
8
Inheritance in Rails - I need some help
I''ve got a model, "category" and another model "subcategory." Each
subcategory belongs_to a category, and a category has_many
subcategories.
What I need to do is set it up so that I can search Category and
Subcategory with one .find call. So:
Category.find(:all, <etc)
will find categories and subcategories.
Now, I believe this can be done by making
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 Mar 15
10
Scaffold with Foreign Key
I have two tables:
------------------------------
drop table if exists users;
create table users (
id int not null auto_increment,
username varchar(100) not null,
password varchar(20) not null,
firstname varchar(20) not null,
lastname varchar(20) not null,
primary key (id)
) TYPE = InnoDB;
------------------------------
drop table
2015 Mar 06
3
LVM encryption and new volume group
Hi Chris,
thanks for your answer.
It is the first time I decided to encrypt my lvm. I choosed to encrypt the volume group, not every logical volume itself, because in case of doing lvm snapshots in that group they will be encrypted too?
And how do I create a new encrypted volume group?
Regards
Tim
Am 6. M?rz 2015 01:58:23 MEZ, schrieb Chris Murphy <lists at colorremedies.com>:
>On
2007 Dec 20
4
dotlock errors without using dotlock
I have a few clients that have more than one user in the same mailbox.
I have my setup using fctrl for mailbox and index locking. My mail is
stored on a network file system (gluster) and my indexes are stored on
the local drive. I have a few issues:
- My users mailboxes have issues where messages will be mixed up (you go
to open a message and it gets a different message)
- messages will
2008 Jun 10
5
Rails params parsing bug?
I have a form that sends the following query string to my Rails
controller:
transaxion[category_association_attributes][][category_id]=2&
transaxion[category_association_attributes][][amount]=12&
transaxion[category_association_attributes][][category_id]=1&
transaxion[category_association_attributes][][amount]=8
But ActionController parses it as:
2006 Sep 28
15
Inserting rows into linking table
Hi,
I have two objects:
Contacts
Lists
I want to be able to add multiple contacts to multiple lists.
I''ve created a linking table and a form that allows me to select the
contacts using checkboxes, but I''m having some problems with the
controller and model.
I receive the following error message when I submit the form:
Mysql::Error: Cannot add or update a child row: a
2015 Mar 06
0
LVM encryption and new volume group
On Thu, Mar 5, 2015 at 10:25 PM, Tim <lists at kiuni.de> wrote:
> Hi Chris,
>
> thanks for your answer.
>
> It is the first time I decided to encrypt my lvm. I choosed to encrypt the
> volume group, not every logical volume itself, because in case of doing lvm
> snapshots in that group they will be encrypted too?
Yes, anything that's COW'd is also encrypted in
2010 Mar 27
2
Shorter Rails 3 routes
Hi,
I have a small blog application, and I would like to shorten its routes.
Here they are:
Blog::Application.routes.draw do
resources :categories do
resources :articles do
resources :comments
end
end
A rake routes command produce the following lines:
GET
/categories/:category_id/articles/:article_id/comments(.:format)
2009 Sep 24
8
Drop down list ?
Hi Gurus, I''m trying to tackle a drop down list. I have category and
item dbs, and they''re wired up with category has_many :items and item
belongs_to :category, and an item has a category_id. I have this code
in my new/edit.html.erb for item:
<%= f.collection_select :category_id,
Category.find_main, :id, :header, {}, :multiple => false %>
And a pretty drop down list
2006 Aug 19
3
Special ruby language for describing sql conditions
I was brainstorming today about a smooth way to define conditions in an
sql query, when the numbers of attributes increase, so does the uglyness.
So instead of passing a hash, I thought you could specify the conditions
directly in code.
I hacked together some example code which actually turned out to work.
The result is concise and pretty beutiful.
def search(params)
Ad.find(:all) do
2006 Jun 14
13
Undefined method
I really hope this is not a bad question (as in he''s abusing the
list). However I could use a little direction (even though I''m
reading books, tutorials)
Right now I''m getting a
undefined method `category'' for 4:Fixnum
The specific lines from the rhtml file are:
<td><%= link_to position.category_id.category, :action => "show", :id
=>
2007 Jul 02
8
Strange intermittent no search results problem
Hello,
First the specs:
ruby 1.8.6, rails 1.2.3, ferret 0.11.4, mongrel 1.0.1, mongrel_cluster 0.2.1
And the model''s aaf config:
# Ferret search engine
acts_as_ferret({:fields => {:name => {:boost => 10},
:summary => {:boost => 2},
:body => {:boost => 1, :store =>
:no},