Displaying 16 results from an estimated 16 matches for "new_items".
Did you mean:
new_item
2006 Feb 03
7
how to add multiple new records from one form
...ey can add up to
20 items to their cart in one form. The form simply has 20 rows with
each row containing a text input for product code and a text input for
quantity.
I''ve tried having the controller create an array that has an object for
each row by looping through something like:
@new_items[1] = Cart.new
and the controller is happy with that, but the template isn''t--it gives
an error like "@new_items[1] is not allowed as an instance variable
name".
I can get the whole thing working if I use non-model form objects in the
template, but then I lose the Rails error...
2006 Mar 26
4
Updating query results in real time with AJAX
I have the following view template:
<%= form_remote_tag :update => "new_item",
:url => {:action => ''create''},
:before => %(Element.show(''spinner'')),
:success => %(Element.hide(''spinner'')) %>
<div id="new_item">
</div>
2006 Aug 18
0
AJAX question
Dear all,
Help me get a simple AJAX behavior right. I know zero AJAX, thus
please advice. Below is a simplification of the real code and I hope
I can describe my intention clearly.
class StoreController < ApplicationController
def show_cart
@cart = Cart.new
@new_item = CartItem.new
end
def add_item
@new_item = CartItem.new(params[:new_item])
if
2006 Aug 18
0
Simple AJAX question
Dear all,
Help me get a simple AJAX behavior right. I know zero AJAX, thus
please advice. Below is a simplification of the real code and I hope I
can describe my intention clearly.
class StoreController < ApplicationController
def show_cart
@cart = Cart.new
@new_item = CartItem.new
end
def add_item
@new_item = CartItem.new(params[:new_item])
if @new_item.valid?
2005 Apr 13
2
Creating multiple option groups
I''m setting up a basic shopping cart type app, and the products we
have will have multiple options. Size, color, etc. I''m trying to
figure out how I can collect the the options that are selected when a
user adds the item to their cart. An OptionSet is a group of options
("Size", "Color", etc), and an ItemOption is the option itself ("12
oz",
2005 Dec 29
1
Has_Many - Saving Child Rows
I have read extensively on has_many but cannot find an explicit example
on how to do what I need. I am a newbie, but can grasp it if I see it in
a working example. Here is my scenario...
I have a form which I can add a TODO item (patterned after
http://darkhost.mine.nu:81/~vince/rails/tutorial.html). I have the form
working perfectly so I decided to modify it a bit to add more
functionality.
2008 Jan 13
3
right usage of bdrb
Hi,
i''m going to implement a syndication-service, which will get lists in
xml with some meta-data an enclosed video files, which will get encoded
at the end. The syndication run will be startet every five minutes of
a full hour.
So i thought to build 4 Worker. One for checking which feeds to
syndicate (syndication_worker) at a specific time, one for processing
the list
2006 Jun 22
0
has_many dynamic conditions
Hello.
I have two models. Channel with last_access field and Item with
created_on field.
They are in one-to-many relation.
class Channel < ActiveRecord::Base
has_many :items
end
class Item < ActiveRecord::Base
belongs_to :channel
end
I want a second has_many relation in Channel, called :new_items which
created_on is newer than last_access. Something like that:
has_many :new_items, :class => "Item", :conditions => ["items.created_on
> ?", last_access]
Unfortunately last_access method is taken from Channel:Class scope, not
from the Channel instance scope so i h...
2006 May 22
0
logger and ActionWebService - how can I get them to work together?
I''m adding a web service to a small Rails app that I wrote to learn
the framework. This is my last piece of the puzzle and I''m having
trouble figuring out how to debug it.
I was attempting to iteratively develop the web service method using
TDD. There''s so much coercion and stuff going on via the
ActionWebService framework that I''m looking to fall-back
2005 Jan 07
3
multicolumn primary keys in activerecord
hi,
I''ve got the following tables in mysql notation:
CREATE TABLE `nodes` (
`id` int(11) NOT NULL auto_increment,
`parent_id` int(11) default ''0'',
`group_id` int(11) default ''0'',
PRIMARY KEY (`id`),
);
CREATE TABLE `groups` (
`parent_id` int(11) NOT NULL default ''0'',
`id` int(11) NOT NULL auto_increment,
2011 Jan 05
16
Nicedit (rich text editor)
Hello, I''m trying to use Nicedit to improve my text_areas in some views
of my project.
I have installed jquery:
ruby script/plugin install git://github.com/aaronchi/jrails.git
nicEdit plugin:
ruby script/plugin install
git://github.com/sergio-fry/Simple-nicEdit.git
Add js in layout:
<%= javascript_include_tag ''nicEdit'', ''nicEditInit'' %>
Use it
2008 Jul 14
18
[git patches] Ocfs2 and Configfs updates for 2.6.27
I'm running a bit late with the e-mail this time around, but I think that's
ok since there really isn't any major new features here - the bulk of the
Ocfs2 update is bug fixes, or cleanups. The same goes for configfs.
The only two things that could be described as features would be:
- Sunil has updated Ocfs2 to provide even more live cluster locking
information via debugfs.
- Joel
2006 Feb 16
0
RJS Question
Hi,
What would my method call in an rjs template to produce something like:
new Effect.BlindDown($(''commentList'').lastChild);
I know if I just wanted to the blind effect I would:
page.visual_effect :blind_down, "row_#{@new_item.id}"
but how would I call it if I want the ".lastChild instead of passing a particular id?
thanks, scott.
2006 Mar 30
4
Select List to change type of STI class
Hi:
I''m trying to create a drop-down list to change the type of a Single
Table Inheritance class. I tried this:
<%= select :user, :type, [ [''Author'', ''Author''],
[''Editor'', ''Editor''],
[''Administrator'', ''Administrator''] ]
2006 Feb 20
0
vpimd, a personal information server
This isn''t even close to ready for release, but in case anybody is
interested, has feedback, finds it useful as is, or even wants to
collaborate...
I''ve been working on a "personal information server", something of a
protocol multiplexer. Right now it serves calendar feeds for:
- a local calendar folder (iCal 1.x''s Library/Calendars)
- rss for local todos
2009 Feb 26
8
beginners question
hi group,
I am making a little rails app to experiment with rails. It consists
of one model, item, that represents an item on a todo list.
A todo item has a description, a state (finished or not) and a due
date.
After changing the scaffold screens a bit, I wanted to be able to
have no due date. I tried to do this by making a radio button; if ''no
date'' is selected, the date