similar to: Design question

Displaying 20 results from an estimated 6000 matches similar to: "Design question"

2006 Apr 18
6
Best Practice for Returning to Calling Page?
I have a partial, it''s a shopping cart display, it''s designed to appear on several different pages of my site. One of the buttons on the shopping cart empties the cart, and then I want the calling page to redisplay. In other words, the cart controller needs to return the visitor to the same page -- however since the cart could appear on any given page, this has to be
2006 Jul 28
15
Store/product stock design question
Hi all, I''m having trouble figuring out how to handle stock levels in a new store I''m building. When products are entered into the admin of the store, they have a stock number associated with them. What I''m not sure about, is how I go about maintaining this stock level. Take this scenario: 1. User A adds an item to their cart, and I check that it''s in stock -
2006 Dec 17
2
Route generation and clash prevention
Let''s say you''re building a movie rental website. You have customers, movies, and rentals to manage. REST style urls might look like this: /customers/4 /movies/15 /rentals You''d probably also want administrators to be able to view all of the rentals done by a particular customer, and other similar details: /customers/4/rentals /movies/15/rentals /rentals/529/customers
2013 Sep 23
1
redirect on browser success, but redirect on functional test is error
line_items.yml: one: product_id: 1 cart_id: 1 quantity: 1 carts.yml: one: {} product.rb: has_many :line_items cart.rb: has_many :line_items, dependent: :destroy line_item.rb: belongs_to :product belongs_to :cart line_item_controller.rb: def destroy @line_item = LineItem.find(params[:id]) @cart = @line_item.cart @line_item.destroy respond_to do |format| format.html
2006 May 23
7
how to pull text from database and eval it?
I''m trying to add some executable code to my blog posts. How can I include this inside of a blog post and eval it? Charlie bowman http://www.recentrambles.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060523/a3536408/attachment.html
2006 Sep 03
2
Undefined method "xxx" of a model when calling a helper
Hi all I''m creating a shop page. I have a cart model that looks like the following: class Cart attr_reader :line_items def get_line_item id @line_items.each do |l| return l if l.id == id end end def initialize @line_items = [] end def empty! initialize end def empty? return true if @line_items.empty? false end end And I have some
2006 Feb 26
3
how to format and syntax highlight code in html
I''ve written my own blog (I know typo is better, but I wanted the experience of writing my own) and I want to add syntax highlighting to it. I''ve read about using the ruby gem syntax but I can''t figure out how to implement it. I''ve also wondered if it could be used in my case. How does it work when you have a long line of code but the <div> your
2006 May 26
11
Weird Caching Issue
Hey all, Here''s the issue... I''m not entirely sure it''s even a Cache-related issue, but here it goes: I''ve deployed a Rails app onto a subdomain of my clients site... The server is running Apache2, and I''m proxying through to Lighttpd. The issue I''m having is that I''m able to add content to the site (data exists in the db), but
2006 Feb 28
5
List and update installed gems?
Hi, could someone tell me how to list and update the currently installed gems on my rails installation? Thanks in advance, -Conrad
2006 May 10
3
NumbersToWords
= numbersToWords - convert your integers and floats to english or japaneese words,or translate it into american currency - This plugin was created from a solution to the ruby quiz (english numbers) by Matthew D Moss. I modified the code to work as a rails plugin and added the to_dollars method. - the to_dollars method will work with integers and floats - the to_english and to_japaneese methods
2006 May 17
1
rails will page cache all actions but one....why?
I have page caching turned on for all actions in my controller (pragmatic is it''s name). Rails will cache each actions except for one. I''ll list the three ways this action can be called. It is only cached one of the ways. Can somebody help? http://www.recentrambles.com/pragmatic/index - This will not cache httphttp://www.recentrambles.com/pragmatic This will not
2006 Apr 28
3
Rails wizard page support
Hello, does anyone know if there is a "best practice" how to implement wizard pages in RoR? I want to have multiple pages for entity editing and creation. Is there any rails plugin available? I think it would be nice to have a howto in the rails wiki or to have built-in wizard support in RoR. What do you think? Any suggestions how to implement this elegant? -- Oliver Paulus OpenPGP
2006 Mar 29
2
vim syntax highlighting of rjs templates
Are there config files for vim that offer syntax highlighting of rjs templates? Charlie Bowman http://www.recentrambles.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060329/486c9d84/attachment.html
2006 Apr 18
11
how to release a plugin
I''ve developed a very useful (at least to me) plugin for rails. How do I go about releasing it. I have an account with rubyforge but I don''t know how to let rails know about it. Charlie Bowman www.recentrambles.com -------------- next part -------------- An HTML attachment was scrubbed... URL:
2007 May 30
2
Depot - empty_cart with ajax
First of all id like to say hi to everyone from Argentina, im yet another Depot first-timer. Going through the example, i got to the point where my cart finally runs Ajax-based. And there is a line where Dave says, after all the job is done "You should see the cart in the sidebar update. And you shouldn''t see your browser show any indication of reloading the page. You''ve
2006 May 22
2
finding out the remote users username ENV[REMOTE_USER] ?
I''m trying to set the modified_by in my user table from the remote user name. I have htaccess set up for the rails directory but I can''t seem to get it to read the remote users name. is ENV[REMOTE_USER] the correct syntax? I searched but I can''t seem to find a definitive answer. Thank you for any help! Charlie Bowman http://www.recentrambles.com -------------- next
2006 Mar 08
2
(no subject)
Can anyone point me in the direction of a good tutorial on visual effects in rails? I''ve searched and I''ve asked but I can''t seem to find any good documentation on ajax visual effects, combining of effects, or queued effects. Charlie Bowman http://www.recentrambles.com -------------- next part -------------- An HTML attachment was scrubbed... URL:
2007 Oct 17
9
@session['user'] vs session[:user]
This might seem really simple to some but just wanted to ask: what is the difference between @session[''user''] and session[:user] ? and how would you use each? And another question, I have the following code: def get_customer if @session[''customer''] @c = Customer.find(@session[''customer'']) end end private def
2005 Mar 06
12
Where to place custom classes?
Hi all, I am writing a simple shopping cart which will consist of a single class. There will be no DB table for carts so I do not want to make my Cart a model. But where do I place my Cart class so that I can access it in my controllers? I want to be able do do things like this (for instance in a shop controller): def add_to_cart @session[''cart''].add(article_id, amount)
2005 Dec 14
9
Passing quantity in a shopping cart
I am using this line on my index.rhtml page to capture the quantity required of a particular item for a basic shopping cart app: <%= text_field ''line_item'', ''quantity'', {:size=>3} %> </td> but my next screen (a cart screen) doesn''t reflect what was entered in that text field when the item is added to the cart. That is,