similar to: question about method "hidden_div_if" in AWDR 2

Displaying 20 results from an estimated 1000 matches similar to: "question about method "hidden_div_if" in AWDR 2"

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 => "cart") %>
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
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
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 26
1
Something is wrong with this peice of code...
<% if @cart.items.empty? %> |^|^|^|^|^|^|^|^|^|^|^|^|^| This peice of code is having a problem in the store.rhtml of my application but i have no idea why... it says that it is and (extracted source... here is the Store.rhtml... this is from an application made in "Ruby on Rails" and it wont tell me how to fix it... iv done everything in the book the exact way its told me,
2005 Nov 29
0
undefined method `link_to'
Hi, all I''m trying call link_to from another helper but got this error: undefined method `link_to'' for module `UserHelper'' how can I get access to helper from another helper? this is my users_helper.rb: module UsersHelper alias ink_to_original link_to alias link_to link_to_permission def link_to_permission(name, options = {}, html_options = nil,
2006 May 10
2
session[:return_to] for going back.
Hi, Is session[:return_to] something Rails maintains to quickly go back to the previous uri without having to keep track of the action name? Or, do we have to actually set it in our actions? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060510/7e36a528/attachment.html
2006 Jun 16
2
DISABLE auto-escaping in image_tag helper
Is there any way to disable image_tag''s automatic escaping of special html entities in it''s :alt tag? Example: >From the controller: @sale[''title''] = ''My Company Product&copy;'' In the view: <%= image_tag(''path/to/file.png'', :alt => @sale[''title'']) %> Output: <img alt="My Company
2006 Apr 20
4
JavaScriptGenerator Dead End
Hi All, I posted earlier about a problem I was having with the various remote view methods escaping all the javascript in my callbacks. I was quickly informed that that''s just what they do, and offered some workarounds. However, in actually working with this, I''m finding that this one little thing is forcing me to write some REALLY ugly code. Where I thought I could
2008 Dec 28
1
escape character problem
Hi, i need to construct a link as following "<a href=\"#{CONFIG[''URLS''][''Xyz'']}\#{url}\"#{tag_options}>#{name || url}</a>" But here due to escape character #{url} not give actual value it treated as a string. how to solve this ? if i do "<a
2007 Oct 01
3
stringify_keys!
I have seen this numerious times and still have no idea what it means: undefined method `stringify_keys!'' for "blah22":String I am tring to change a password. My code looks like: def change_password @user = User.find_by_emailaddr( params[:email] ) if @user.nil? # user profile not created flash[:notice] = "<b style = \"color:red\">No such
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,
2007 Jul 22
2
undefined method `stringify_keys'
Hello I have a view for user registration but when i try to view this page i get this error: undefined method `stringify_keys'' for "username":String Here''s my registration.rhtml: <% form_tag :controller => :user, :action => :register do %> <fieldset> <label for="username">Username>/label><br/><%= text_field_tag
2005 Aug 29
2
Where to point the browser to for appdoc documentation
Under windows XP I created a batch file in the depot directory this takes care of generating the application documentation. The default rake appdoc isn''t working under windows right now (remove the -T option). So, where do I point my browser to (so that I can view the new generated application documentation)? Running gem_server didn''t help so far... listing doc.bat rdoc -o
2006 Mar 09
2
clarify
im learning rails and i got a error while writing a sample code. Script : ------- class GuestBookController < ActionController::Base def index @entry = GuestBook.find_all end def list_parameters params = request.parameters render :text=>"Parameters #{params}" end def list params = request.parameters @entry = GuestBook.new(params[:name])
2006 Mar 25
0
in_place_collection_editor
Hi, I''m trying to write a helper for Scriptaculous'' InPlaceCollectionEditor component. I''ve already submitted a patch (http://dev.rubyonrails.org/ticket/4302). This was a drunk patch; it needs a bit of work (Don''t drink & code!). So far I''ve gotten it to work correctly with normal collections, but I want to use it for belongs_to relations as
2005 Dec 22
3
NewbieQ : undefined method `stringify_keys!'' Dumb Question
Hi, I''m running round in circles again! I''m trying to save a note that has a HABTM relationship with a job. The note is new - the job exists. In my partial for notes I have ; <%= start_form_tag :action => ''new_note'', :id => @job %> <%= text_area_tag "note", nil, :size => "65x10" %> <%=submit_tag
2006 Jan 21
1
HELP: NoMethodError (undefined method `stringify_keys!'' for
We have a flash developer who is intergating with a rails application when he posts a particular variable (in this case ''rating'') We get a ''Rails Application Error'' Trawling the production log turns up this error; NoMethodError (undefined method `stringify_keys!'' for "10":String): The html wireframe has no such problem. A select box is
2006 Oct 25
1
Help with a select_tag; getting an undefined method `stringify_keys' error
Hi, I''m trying to use a select_tag in the following manner: <%= select_tag(:received_at, @select_dates, String(params[:received_at]) ) %> But I get this error: undefined method `stringify_keys'' for "":String Removing the third parameter eliminates the error, but I was hoping that the drop-down list will select whichever string in the drop-down list matches
2006 Nov 20
1
undefined method `stringify_keys!' for "4":String - Meaning of this?
Hi, I have the following on a view <% for evaluation in @evaluations %> <td><%=h evaluation[0].name %></td> <td><%=evaluation[1].object_id %></td> <td><%= link_to( "Start", :action =>''evaluatie'', :id => evaluation[1].object_id) %></td> <%end%> When I click on the link, I can see that