search for: hidden_div_if

Displaying 9 results from an estimated 9 matches for "hidden_div_if".

2008 Jul 14
1
question about method "hidden_div_if" in AWDR 2
I followed the sample code in AWDR 2 like this: store_helper.rb def hidden_div_if(conditions, attributes = {}) if conditions attributes["style"] = "display:none" else attr = tag_options(attributes.stringify_keys) "<div #{attr}>" end end store.html.erb <%= hidden_div_if(@cart.items.empty?, :id => "cart") %&gt...
2007 Aug 23
2
need help trying to debug - included screenshot
I have attached a screen shot of the error I am running into. I am on page 138 of the Agile Web Development with Rails book by Pragmatic Programmers. I am developing the depot store, and I ran into an error, with hidden_div_if. When I remove that block of code, things to work fine, besides the fact the cart does not display on the site, but everything else functions correctly, so it is something with that line 20 of code. <% hidden_div_if(@cart.items.empty?, :id => "cart") do %> Look at the screen s...
2006 Jul 26
2
There is Something wrong with the div...
<div id="cart"> <% if @cart.items.empty? %> style="display: none" <% end %> <%= hidden_div_if(@cart.items.empty?, :id => "cart") %> i dont know how to fix it, iv looked all over the book ruby on rails and cant ever find whats wrong with it... -- Posted via http://www.ruby-forum.com/.
2006 Jul 13
1
From the Agile book, page 144 regarding a div tag helper
Hi. in the Rails Agile book here''s what was happening: >>> module StoreHelper def hidden_div_if(condition, attributes = {}) if condition attributes["style" ] = "display: none" end attrs = tag_options(attributes.stringify_keys) "<div #{attrs}>" end # format_price method ... end Note that we cheated slightly here. We copied code from the Rails standard help...
2007 Mar 23
1
How does this helper work? (agile book)
Hello, Im trying to understand how this helper method works: def hidden_div_if(condition, attributes = {}) if condition attributes["style"] = "display: none" end attrs = tag_options(attributes.stringify_keys) "<div #{attrs}>" end This is how they are calling it: <%= hidden_div_if(@cart.items.empty?, :id => &qu...
2006 Jul 26
1
Something is wrong with this peice of code...
...le || "Bo Rizzle''s bookshelf" %> </div> <div id="columns"> <div id="side"> <div id= "cart" --------------> <% if @cart.items.empty? %> style="display: none" <% end %> <%= hidden_div_if(@cart.items.empty?, :id => "cart") %> <%= render(:partial => "cart", :object => @cart) %> </div> <a href="http://www....">Home</a><br /> <a href="http://www..../faq">Questions</a><br /&g...
2006 Jul 26
0
Something wrong with the div
<div id="side"> <div id= "cart" line 16----> <% if @cart.items.empty? %> style="display: none" <% end %> <%= hidden_div_if(@cart.items.empty?, :id => "cart") %> Whenever i press on checkout it says....You have a nil object when you didn''t expect it! The error occured while evaluating nil.items, Extracted source (around line #16): -- Posted via http://www.ruby-forum.com/.
2011 Aug 02
1
NoMethodError in Store#index
...653'' app/views/carts/_cart.html.erb:3:in `_app_views_carts__cart_html_erb___244752806_13248624_537741326'' app/views/layouts/application.html.erb:37:in `block in _app_views_layouts_application_html_erb___681624400_16614672_759801029'' app/helpers/application_helper.rb:6:in `hidden_div_if'' app/views/layouts/application.html.erb:36:in `_app_views_layouts_application_html_erb___681624400_16614672_759801029'' -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group....
2008 Jul 12
6
Create db row in my partial template
Hi, When I use script/generate scaffold for my db it automatically creates that page where I can select to add a new item to the database. In the controller, the create method looks like this: def create @user = User.new(params[:user]) respond_to do |format| if @user.save flash[:notice] = ''User was successfully created.'' format.html {