Displaying 20 results from an estimated 600 matches similar to: "HABTM with multiple select list"
2010 Dec 16
3
Samba upgrade question
Hi All,
I have a problem with upgrade samba on Solaris 10 (x86). The current version is 3.0.25b (distributed with Solaris 10). I am trying to upgrade version to 3.4.5. I compiled samba from sources, has not any problem with make and installation. Now I have 2 different versions and when I am running "svcadm enable samba" I am receiving old version.
The old version installed under:
2006 Jun 07
1
How do YOU read/update HABTM?
In my mind, it should work like this:
<%= select ''item'',
''category_ids'',
Category.find(:all).collect {|c| [c.name, c.id] },
{},
{:multiple=>true, :size=>20} %>
Then Rails should automatically populate and update HABTM on that. As it
is now, the above won''t work (I created a getter in item''s model that
returns an array of
2006 Jun 18
6
integer array columns
Postgres database.
I have a categories table, with two columns id, and name.
I have a recipes table, with a category_ids column.
I want each recipe to belong to one or more category.
in recipe_controller.rb I have this:
def create
@recipe = Recipe.new( @params[''recipe''] )
@recipe.category_ids = @params[''recipe''][''category_ids''].map{
2006 May 31
3
instance variable problem
I''m having some trouble with an instance variable being read as nil in
my app. I have an image uploading, that can be added to categories.
The page loads up initially fine, and if I upload an image without
errors everything works fine. I''m working on the validation, but with
the code I have if their are validation errors it renders ''new'' again,
but reads
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
2010 Dec 25
6
undefined local variable or method?
I have:
<%= form_for(@supplier) do |f| %>
.......
......
<%= render ''sector_categories'', :locals => {:f => f} %>
in _sector_categories partial I have:
<div class="field">
<div id="category_update">
<% for category in @categories %>
<%= f.check_box :category_ids[], category.id,
2009 Jun 22
5
has_many through , or habtm , using form
i think there ara two ways of relate products and categories ,
basically i want to fix one product(e.g hp dv7....) to some categories
(notebook,17"notebooks...)
i made a table named categorization(incuding category_id,product_id
fields) then in models i write these codes below
class Product < ActiveRecord::Base
has_many :categories, :through => :categorizations
2006 Feb 14
1
Another HABTM Question
Hi there,
I have a question on what would be the best way to save a HABTM model.
A posting habtm categories, and a category habtm postings.
class Category < ActiveRecord::Base
has_and_belongs_to_many :postings
end
class Posting < ActiveRecord::Base
has_and_belongs_to_many :categories
end
In my blog_controller, where the actual posting is saved, is where I
think I''m
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
2007 Dec 31
2
episode 73 resulting in error: undefined method `stringify_keys!' for "33":String
I''m working with a similar model in Episode 73, (my scenario is
editing multiple pictures for a product using attachment_fu).
And I''m getting an error when I try the technique suggested:
./views/admin/_form.rhtml
<% for picture in product.pictures %>
<% fields_for "product[picture_attributes][]", picture do |
picture_form| %>
Title: <%=
2006 Jul 12
1
odd habtm behavior? or is it me?
Hello List,
I''m a bit spent on this problem, and my code might be whack. I seem to be
encountering a problem where the primary key on a join table is not being
resolved correctly. I will elaborate after some code bits. I am creating
the join table using migrations, and relevant model code is this:
class Post < ActiveRecord::Base
has_and_belongs_to_many :records
2006 Apr 05
3
CRUD pattern for has_many relationships (forms containing collections)?
Hello folks!
Beare with me for a second, while I explain my problem.
Assuming we have the trivial model of
class Author
has_many :books
end
class Book
end
How do people go about creating the authors/edit and authors/new
views if you want to be able to add and remove arbitrary amount of
Books at Author creation and edit time? What I mean by this is that I
go to
2006 Jun 20
0
options_from_collection_for_select question
I am doing the recipe/category example, but with a
has_many_and_belongs_to relationship. To select categories for a
recipe, I have a select control. When editing, I want the proper
categories selected. In order to get it to work, I put this in my
_form.rhtml:
<select id="recipe_categories" name="recipe[category_ids][]" size="4"
multiple>
<%=
2005 Dec 28
1
making has_and_belongs_to_many save more elegant
When a user creates a post I also want to save all the tags
associated with it. I do that in the post_controller like this
presently:
def save
@post = Post.new(@params[:post])
@tags = Tag.new(@params[:tags])
@post.user_id = session[:id]
if @post.save
@tags.title.split('','').each do |tag|
present_tag = Tag.find_by_title(tag.strip)
present_tag =
2011 Sep 29
5
5.7 x86_64 DVD iso
I am trying to find a DVD iso that is not a torrent, and looking through
the mirrors I am unable to find one. Does anyone happen to have a mirror
or repository that they know of that carries the DVD iso for direct
download? I am behind a pretty strict firewall and am unable to do
torrents.
Thanks in advance
Michael Weiner
===================================
Please consider the environment
2006 Feb 28
1
Wrong id after join!
The Problem
-----------
After using a join in my find the id attributes set in my Entity objects
are wrong! It is setting the Entity id to the value from Postcode id!
The Code
--------
entities = Entity.find(:all,
:conditions => [...omited...],
:joins => "as e inner join postcodes as pc on
substring_index(e.postcode,'' '', 1) =
2011 Apr 04
3
Adjusting p values of a matrix
Dear all,
I have an n x n matrix of p-values. The matrix is symmetrical, as it
describes the "each against each" p values of correlation
coefficients.
How can I best correct the p values of the matrix? Notably, the total
number of the tests performed is n(n-1)/2, since I do not test the
correlation of each variable with itself. That means, I only want to
correct one half of the matrix,
2001 Oct 29
3
ext3 and 2.4.x kernels
Dear list readers -
it was brought to my attention that during the upgrade of a server to rh7.2,
and selecting the ext3 migration works well with 1 exception that i need
verified if i could please. i heard that once you migrate to ext3, you may
no longer do a kernel upgrade without downgrading to ext2 and then putting
the kernel or AC kernel in place 'patched'. What i need to know
2006 Oct 10
5
read.table() and scientific notation
Dear all,
I am having troubles importing values written as scientific notation
using read.table(). I'm sure this is a frequent problem, as many
people in my lab have this problem as well, so I'm sure that I just
have troubles googling for the right solution.
The problem is, that, given a file like that:
a 1 2e-4
b 2 3e-8
...
the third column gets imported as a factor, or a string if I
2015 May 14
2
Creating a vignette which depends on a non-distributable file
Dear all,
I am writing a vignette that requires a file which I am not allowed to
distribute, but which the user can easily download manually. Moreover, it
is not possible to download this file automatically from R: downloading
requires a (free) registration that seems to work only through a browser.
(I'm talking here about the MSigDB from the Broad Institute,