# Beginner on rails! customize store. "Agile web development"

**URL:** <https://www.ruby-forum.com/t/beginner-on-rails-customize-store-agile-web-development/77278>\
**Category:** Rails\
**Created:** [November 25, 2006, 10:20pm UTC](https://www.ruby-forum.com/t/beginner-on-rails-customize-store-agile-web-development/77278 "2006-11-25T22:20:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f0a364/32.png) [@richard](https://www.ruby-forum.com/u/richard)\
**Post date:** [November 25, 2006, 10:20pm UTC](https://www.ruby-forum.com/t/beginner-on-rails-customize-store-agile-web-development/77278/1 "2006-11-25T22:20:19Z")

</div>

hey all!  
Uhm, dumb topic perhaps, my bad. Anyway, ive read the “How to create a  
shop” in the book “agile web development”. But no i’d like to add some  
options to the product in the store, so the future customers can choose  
ie. a bike, and then select color and size of that bike. Iv’e given  
this function ALOT of taught but haven’t been able to figure it out by  
myself, can anyone around here please help me?

It would be nice if the user could select it from a dropdown-list, but I  
have no clue about how to do that. Then i figured “I’ll just let the  
useres type in their options in a textfield”, but then yet again. I  
don’t know how to store that kind of data in a session.

Regards / Richard.

---

<div class="post-metadata">

**Author:** ![richard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f0a364/32.png) [@richard](https://www.ruby-forum.com/u/richard)\
**Post date:** [November 25, 2006, 10:55pm UTC](https://www.ruby-forum.com/t/beginner-on-rails-customize-store-agile-web-development/77278/2 "2006-11-25T22:55:51Z")

</div>

On 11/25/06, Richard [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> hey all!  
> Uhm, dumb topic perhaps, my bad. Anyway, ive read the “How to create a  
> shop” in the book “agile web development”. But no i’d like to add some  
> options to the product in the store, so the future customers can choose  
> ie. a bike, and then select color and size of that bike. Iv’e given  
> this function ALOT of taught but haven’t been able to figure it out by  
> myself, can anyone around here please help me?

How would you do it in raw HTML? Get a book on that (you can probably  
augment it with

I always Google for HTML

```
site:microsoft.com html select option

```

When I wonder about select boxes. MS’s HTML documentation is all in  
one site (or three), with no popup adds or other nonsense.

> >

–  
Phlip  
[http://c2.com/cgi/wiki?ZeekLand](http://c2.com/cgi/wiki?ZeekLand) ← NOT a blog!!

---

<div class="post-metadata">

**Author:** ![richard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f0a364/32.png) [@richard](https://www.ruby-forum.com/u/richard)\
**Post date:** [November 25, 2006, 10:57pm UTC](https://www.ruby-forum.com/t/beginner-on-rails-customize-store-agile-web-development/77278/3 "2006-11-25T22:57:51Z")

</div>

[F—ing AJAX!!!]

Richard wrote:

> Uhm, dumb topic perhaps, my bad. Anyway, ive read the “How to create a  
> shop” in the book “agile web development”. But no i’d like to add some  
> options to the product in the store, so the future customers can choose  
> ie. a bike, and then select color and size of that bike. Iv’e given  
> this function ALOT of taught but haven’t been able to figure it out by  
> myself, can anyone around here please help me?

How would you do it in raw HTML? Get a book on that; you can probably  
augment it with a Bookmark on your favorite online HTML tutorial.

I always Google for HTML like this:

site:microsoft.com html select option

When I wonder about select boxes. MS’s HTML documentation is all in  
one site (or three), with no popup adds or other nonsense.

> It would be nice if the user could select it from a dropdown-list, but I  
> have no clue about how to do that. Then i figured “I’ll just let the  
> useres type in their options in a textfield”, but then yet again. I  
> don’t know how to store that kind of data in a session.

Once you get the raw HTML down, you can move up to a FormHelper called  
select().

–  
Phlip  
[http://c2.com/cgi/wiki?ZeekLand](http://c2.com/cgi/wiki?ZeekLand) ← NOT a blog!!

---

<div class="post-metadata">

**Author:** ![richard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f0a364/32.png) [@richard](https://www.ruby-forum.com/u/richard)\
**Post date:** [November 26, 2006, 12:34am UTC](https://www.ruby-forum.com/t/beginner-on-rails-customize-store-agile-web-development/77278/4 "2006-11-26T00:34:00Z")

</div>

On Nov 25, 2006, at 5:14 PM, Richard wrote:

> select(“product”, “product.sizes\_colors”,  
> product.sizes\_colors.split(’.’))
> 
> is what i used to create the form. It would return a string of text  
> (ie  
> large blue) but where and how can I temporarily store this data?

Would it not be part of the model?

Dave

---

<div class="post-metadata">

**Author:** ![richard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f0a364/32.png) [@richard](https://www.ruby-forum.com/u/richard)\
**Post date:** [November 26, 2006, 12:14am UTC](https://www.ruby-forum.com/t/beginner-on-rails-customize-store-agile-web-development/77278/5 "2006-11-26T00:14:04Z")

</div>

Phlip wrote:

> [F—ing AJAX!!!]
> 
> Richard wrote:
> 
> > Uhm, dumb topic perhaps, my bad. Anyway, ive read the “How to create a  
> > shop” in the book “agile web development”. But no i’d like to add some  
> > options to the product in the store, so the future customers can choose  
> > ie. a bike, and then select color and size of that bike. Iv’e given  
> > this function ALOT of taught but haven’t been able to figure it out by  
> > myself, can anyone around here please help me?
> 
> How would you do it in raw HTML? Get a book on that; you can probably  
> augment it with a Bookmark on your favorite online HTML tutorial.
> 
> I always Google for HTML like this:
> 
> site:microsoft.com html select option
> 
> When I wonder about select boxes. MS’s HTML documentation is all in  
> one site (or three), with no popup adds or other nonsense.
> 
> > It would be nice if the user could select it from a dropdown-list, but I  
> > have no clue about how to do that. Then i figured “I’ll just let the  
> > useres type in their options in a textfield”, but then yet again. I  
> > don’t know how to store that kind of data in a session.
> 
> Once you get the raw HTML down, you can move up to a FormHelper called  
> select().
> 
> –  
> Phlip  
> [http://c2.com/cgi/wiki?ZeekLand](http://c2.com/cgi/wiki?ZeekLand) ← NOT a blog!!

Iv’e managed to create the dropdownlist, but the problem is; How do I  
get the selected value to be stored in the session and then later viewed  
in the ‘cart’?

select(“product”, “product.sizes\_colors”,  
product.sizes\_colors.split(‘.’))

is what i used to create the form. It would return a string of text (ie  
large blue) but where and how can I temporarily store this data?

I’m really grateful for the link above, it did sort out a few things!

---

<div class="post-metadata">

**Author:** ![richard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f0a364/32.png) [@richard](https://www.ruby-forum.com/u/richard)\
**Post date:** [November 26, 2006, 4:40am UTC](https://www.ruby-forum.com/t/beginner-on-rails-customize-store-agile-web-development/77278/6 "2006-11-26T04:40:12Z")

</div>

You might find my book useful. See my sig. 🙂

–  
Building an e-commerce site with Rails?  
[http://www.agilewebdevelopment.com/rails-ecommerce](http://www.agilewebdevelopment.com/rails-ecommerce)

---

<div class="post-metadata">

**Author:** ![richard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f0a364/32.png) [@richard](https://www.ruby-forum.com/u/richard)\
**Post date:** [November 26, 2006, 12:58am UTC](https://www.ruby-forum.com/t/beginner-on-rails-customize-store-agile-web-development/77278/7 "2006-11-26T00:58:01Z")

</div>

Richard wrote:

> Iv’e managed to create the dropdownlist, but the problem is; How do I  
> get the selected value to be stored in the session and then later viewed  
> in the ‘cart’?
> 
> select(“product”, “product.sizes\_colors”,  
> product.sizes\_colors.split(‘.’))
> 
> is what i used to create the form. It would return a string of text (ie  
> large blue) but where and how can I temporarily store this data?

It comes into your action in your params[], right? Add this:

p params

if it’s there, you can copy it to the session or model. (Prefer the  
model,  
because statelessness is good for transactions…)

–  
Phlip  
[Redirecting...](http://www.greencheese.us/ZeekLand) ← NOT a blog!!!
