similar to: outputing table data

Displaying 20 results from an estimated 900 matches similar to: "outputing table data"

2011 Feb 09
16
rails 3.0.4 broke yield :javascript ?
hello, I have today updated my rails app to 3.0.4 security release but now this yield :javascripts fails in the layout and I get my custom js escaped as text in the view. anybody seeing this also? tia, jk -- www.least-significant-bit.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to
2006 Apr 08
5
What is the h for?
In the "Agile Web Development with Rails" book it runs through making an example application, a shopping cart. In one of the views files, there is one line of code I dont understand (below), I dont know what the "h" is for, also I took the h out, and it did not affect the application (as far as i could see). <%= h(product.title) %> Can anyone shed some light on this
2011 Aug 25
7
How to safely embed JSON object in HTML document
Hi all, I''m working on a Backbone.js single page app with Rails 3.1, and in an attempt to save on HTTP requests, I want to embed initial data set in a HTML document that is sent back to the browser after successful login. I was thinking I can simply convert my ruby object to JSON, then HTML escape resulting string of JSON, and then use that as a value for JavaScript variable. Something
2006 Jan 27
10
html special characters. h() failure.
I was trying to convert a some text with the (r) character it so it replaced character \xAE with &reg; h(@item.description) didn''t do anything. I need to use @item.description.grep(/\xAE/,''&reg;'') for it to work. I think the h() function should be able to do all the codes that are available. Regards Neil.
2006 Jan 18
7
Inspect
I am seeing a curious anomaly with the inspect method. It displays one of the objects in a way I don''t understand. I''ll use the Recipes example to illustrate. First, I''ll describe the recipes table, then show how the @recipe variable is being created in the controller and passed in to the show view, and then show how I''m using the
2006 Sep 07
5
url_for always escape string.
according to the documentation, only the url_for from ActionView escape the URL. which happens on this line escape ? html_escape(url) : url and can be prevented by passing :escape => false to url_for. still according to the documentation, the url_for from ActionController is not supposed to escape the url. BUT IT DOES. at the moment of this line escape ? html_escape(url) : url url has
2006 Dec 24
8
HABTM Reading Rows From Two Tables
I''m a newbie and loving rails but I''m stuck. All I want to do is to be able to show in my "list.rhtml" view the information between two tables who both have a HABTM relationship. So this is what I have as follows. -------------------------- TABLES -------------------------- # Projects create_table "projects", :force => true do |t| t.column
2006 Jan 22
9
ERROR: undefined method `h'' for ERB::Util:Module
ERROR: undefined method `h'' for ERB::Util:Module i get above error when i use ERB::Util.h(content) in my controller''s action. can any one one tell me how to use this ''h'' method within controller? thanks, Jigar Gosar http://jigar.org -- Posted via http://www.ruby-forum.com/.
2006 Jan 18
4
Ruby "htmlentities" replacement: code review please!
Hi Railers, For some time now I''ve been looking for a decent Rails equivalent of PHP''s "htmlentities" command, because ERB''s html_escape (or more commonly called as just "h", eg. <%=h @somevariable %> ) just doesn''t go far enough for me. Back in PHP land, I actually had an extended version of the htmlentities command to deal with
2005 Dec 29
3
What does ''h'' do?
I''m sure a real newbie question, but try searching for ''h'' in any search engine and you don''t get far. I am wondering what the h does in Ruby as in the code below: <%= h(truncate(product.description, 80)) %> -- Posted via http://www.ruby-forum.com/.
2006 May 30
7
Stripping HTML tags from a string
Hello, Is there a common way of stripping html tags from a string? Right now I''m just calling gsub!(/<.*?>/, ''''), but with a background in PHP and always having used its strip_tags() method, I wonder if the Rails community has standardized this fairly common task with something a bit less simpleminded than my quick fix. Thanks! Zack -------------- next part
2008 May 13
0
Problem geting web interface to work
Hi, i have installed CruiseControlRB 1.3.0. With no project added the web interface at localhost:3333 looks find. I have successfully added one of my projects (batch file which builds some c++ code) which is also building fine. But the web interface is no more working - i get the following message "Errno::EINVAL in Projects#index". I have attached a log (run with --trace) which
2006 Jun 27
1
find (ordering by field in related table)
Hi, I am using the rails find command as below @project_pages, @projects = paginate :projects, :per_page => 20, :conditions => "clients.organisation_id = " + params[''search''][''organisation_id''], :joins => ''inner join clients ON clients.id = projects.client_id'' There seems to be a problem with project.id being over written
2006 Jan 25
4
html special char conversion
I''ve stucked to such problem: I have html entities in database, after using scaffold I''ve got these chars not converted (I have strictly " and & in page source). It is what I need, but after making ./script/generate scaffold modelname controllername (recreating controller) I''ve got all special chars converted into entities like (&quot and others). How can
2006 Jul 13
4
script injection/cross-site scripting protection
When is it possible to set <script>while(true){}</script> as the value of project.name, what it the best way to escape the output of the following? <td><%= project.name %></td> Dennis Byrne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060713/bbdedb86/attachment.html
2006 May 10
2
gain value from form
I have the following form <%= start_form_tag :action => ''rejectQuoteSave'', :id => @project %> <p><label for="offer_reason_rejected"><span class="required">* </span>Reason</label><br/> <%= text_area ''offer'', ''reason_rejected'' %></p> <%= submit_tag
2008 Apr 21
1
Urgent ActiveRecord has_many Problem - Please Help
Hi Guys, I''ve been looking everywhere for an answer to this but so far without success. I have three models: 1) employees has_many :memberships has_many :projects, :through => :membership 2) projects has_many :memberships has_many :employees, :through => :membership 3) membership belongs_to :employees belongs_to :projects Membership is used to join employees
2005 Dec 16
13
How to pass a collection to paginate?
There must be a better way to write this code: @project_pages, @projects= paginate :project, :per_page => 10, :conditions => ["account_id = ?", account] ?! If only I could pass the sub-collection account = ... @projects = account.project to paginate, instead of letting it extract it with a find :all + sql conditions Alain. -- Posted via
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
2006 Mar 18
2
Need help with my view populating rows
Hello, I was talking with someone in IRC, trying to get one form with however many fields to make new rows. He worked with me on the controller, but then I didn''t get the help with the view I needed, and I''ve been trying to do it on my own. I''m uploading pictures to my Pictures table. As you know, I need a few fields for each picture. I''ll need the filename,