Displaying 20 results from an estimated 200 matches similar to: "has_many_polymorphs and acts_as_list ?"
2006 May 20
7
Polymorphic, many-to-many, self-referential data model
No matter what I try I''ve been unable to work how to get this to work with
the cool ActiveRecord helpers. I''m not sure if it''s possible, Josh Susser''s
blog suggests it is, but damned if I can work it out...
I have:
Container which can contain one or more Element. An Element is a polymorph
of either a Container or a Chunk. An Element can exist in one or more
2006 Mar 24
1
Multiple table relationships
Hello,
I''m just starting out with some Rails development and have the following
table structure. I understand how to do a two table has many join but I
actually need to relate a third table. Here is my structure:
components
id
name
updated_at
elements
id
name
updated_at
element_types
id
name
updated_at
components_elements
component_id
element_id
2006 Jun 24
6
Ajax fade effect
I have a list of categories, when I delete one of them, I want that item
to fade and then get removed. So I do the following:
1. home_controller:
def delete
@category = Category.find_by_name(params[:name])
@element_id = @category.name
Category.delete_all(["name = ?", @category.name])
end
2. delete.rjs:
if @element_id
page.visual_effect :fade, @element_id
2006 Jun 19
10
Trying to delete from a unordered list using ajax
I have a controller method as such:
def delete
@category = Category.find_by_name(params[:name])
@element_id = @category.name
Category.delete_all(["name = ?", @category.name])
end
(For the purpose of this exercise, category names are unique)
I have the corresponding delete.rjs file:
if @element_id
page.remove :id => @element_id
page.visual_effect :highlight,
2006 Apr 07
2
Re: Re: page.replace_html "#{var_containing_id_name}", :partial
> you mean like this?
>
> def do_some_ajax_thing
> <at> element_id = "content_div"
> end
>
> do_some_ajax_thing.rjs
>
> page.replace_html <at> element_id, :partial => "edit"
>
> remember, the view templates have access to the attributes defined
> in the controller
Actually, its more like this: I have a list page. Each row
2006 Jan 25
2
Using ''GET''-method in Forms
Hi all,
I''m using a selection-list / dropdown-list to choose an element in a number
of grouped elements. Is there a way of passing an element_id to the form AND
using the HTTP-''get''-method? I found that the <% start_tag %> has a
:method-switch as an option, but it passes the arguments on like
"/controller/action/?action=1". I would need something like
2010 Mar 23
1
has_many_polymorphs with searchlogic
Has anyone been able to use searchlogic with has_many_polymorphs?
Are they compatible?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2008 Mar 05
0
Overloaded has_many_polymorphs method is still being called
I have a has_many_polymorphs class called Property. For the various
classes that are polymorphs, i''ve written a module with methods relating
to Property, that they can all include.
One of my methods is called ''add_properties'': it creates some new
associations, but also does a couple of other things (such as update the
object''s ferret index, and return a
2007 Nov 29
0
has_many_polymorphs for user owned tags
Hi all,
I''m trying to extend the tagging functionality of has_many_polymorphs to
work with user owned tags - ie, putting belongs_to :user in the Tagging
model.
So I changed the index in the generated migration, and added user_id to
the taggings table.
Then I added belongs_to :user in the Tagging model.
In the lib/tagging_extensions.rb file I added a new function:
def
2008 Sep 26
0
self-referential tags, has_many_polymorphs
Hi,
I''m looking to add tagging to an application, and I would like to allow
self-referential tags, so that I can tag my tags. With the goal of
generating a flexible tag hierarchy.
After some googling it looks like acts_as_taggable is not the best piece
of code, and I''m hoping to use the has_many_polymorphs plugin from
http://github.com/fauna/has_many_polymorphs/tree/master.
2008 Feb 11
3
Should there be trouble w/has_many_polymorphs in a plugin?
Folks,
As much as I like generators, I''d greatly prefer to just throw my
has_many_polymorphs tagging and commenting engines into projects as
plugins. However, after transplanting my tag.rb and tagging.rb files
into the lib folder of a ''has_many_tags'' plugin and adding the
obligatory plugin requirements (init.rb and an include in
environment.rb), I''m not having
2008 Mar 05
4
has_many_polymorphs is breaking my spec file
Hey folks
I have a bunch of classes that are polymorphs, with has_many_polymorphs
(they are all ''labellable'', which is similar to being ''taggable'' in the
acts_as_taggable scheme). I have a couple of modules,
LabellableInstanceMethods and LabellableClassMethods in a file called
labellable_methods.rb.
The classes all get labelled with
2005 Oct 14
6
Draggables onDragStart
Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 1027 bytes
Desc: image001.gif
Url : http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20051014/b3c26edf/attachment.gif
2015 Apr 09
2
[LLVMdev] BNF for IL/IR interpreter
This might be a very beginner question, but I'm looking for an example for
something that I have never done.
Suppose that I wanted to express actions with respect to lifted semantics
of CPU instructions to an intermediate representation, BAP IL or LLVM IR.
How might I go about providing a Backus Naur Form specification and then
dynamically interpreting those lifted instructions by also
2006 Apr 05
1
New AJAX function: remote_replace_with_partial() <-- write less code
I hate writing controller actions that support simple lightweight
ajax calls like this:
def show_buttons
render :partial => "home_buttons"
end
So the birth of remote_replace_with_partial
Now you can replace a div elements with any controllers partials and
pass those partials any number of params without having to write
supportive actions in your controllers. This is a great
2010 Jan 20
0
putting labels back on a matrix.
I did not post this question to the ecology list, even though it is about an analysis using Vegan, since my question is based more on basic data manipulation in R. I think this is a fairly simple question but for the life of me I cannot find a reference for in the archives.
I have an analysis using a matrix in which I needed to strip the ID variable off the input data to run the analysis. Now I
2006 Apr 07
2
Re: page.replace_html "#{var_containing_id_name}", :partial
Jeff Coleman <progressions@...> writes:
>
> Jason Tuttle wrote:
> > The subject line says it all. -- Is there a way to do something
like:
> >
> > page.replace_html "#{var_containing_id_name}", :partial => ''edit''
> >
> > That line of code does not work, but I would like to pass the
name of
> > a variable to
2006 Sep 29
3
no setClassName or removeAllClassNames in prototype - why?
Often I have the need to set one class name to an element. I don''t care
what was there before, just remove it and set it to the new class. I
don''t see any easy way to remove all the class names or to set just one
class name. Why is this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
2018 Jan 23
2
RFC: Towards unified semantic for casts
Hi everyone,
I have an idea that should allow reducing code duplication in Casting.h
while making llvm::isa, llvm::cast, llvm::dyn_cast, etc more generic. Since
we added unique pointers support for these template functions (see
ab480f45cd23c08cb9aa3f427aad072df249135f) I propose to generalize their
semantics to deal with any pointer-like type (i.e. dereferenceable and
implicitly convertible to
2019 Aug 29
2
enable_shared_from_this fails at runtime when inherited privately
Hello,
I just discovered, that, when using enable_shared_from_this and
inheriting it privately, this fails at runtime.
I made a small example:
#include <memory>
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
#include <boost/enable_shared_from_this.hpp>
#ifndef prefix
#define prefix std
#endif
class foo:
prefix::enable_shared_from_this<foo>
{