similar to: Railscast 262 different partial in helper

Displaying 20 results from an estimated 200 matches similar to: "Railscast 262 different partial in helper"

2010 May 17
6
Should an blank string be html_safe?
Just trying to implement a simple helper over the past few days had me really confused. messages = '''' messages << content_tag(:p, ''dave'') #=> &lt;p&gt;dave&lt;\p%;gt; Eventually I realised the original empty string was not html_safe message = ''''.html_safe message << content_tag(:p, ''dave'') #=>
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
2010 Nov 05
9
[patch] Let's use <%== %> instead of <%= raw() %>
I''ve submitted a small patch to make Rails behave properly with the Erubis <%== %> construct. For some reason the current behaviour of that tag in Rails 3 is to escape the contents _twice_ which is probably a bug. I offer three suggestions why this is a good idea: - The syntax is cleaner. It can avoid a lot of .html_safe and raw in your views. I especially like the conciseness of
2011 Jul 15
3
Ruby variable that embeds html tags
This seems very simple, but I can''t quite get it. Probably because I''m just starting out with RoR. My view has a slew of labels and text fields; many are "required": <%= f.text_field :screen_name %> <span class="required_field">Required field</span> (The "required_field" class turns the text red and smaller.) I''d like to
2010 Aug 03
7
rails 2.3.8 and html_safe
Hi, Can somebody update me on the state of html_safe strings in rails 2.3.8? I know rails 2.3.6 and 2.3.7 broke a lot of code because strings were being escaped when they shouldn''t have been and I thought this was all fixed in 2.3.8. I''m upgrading an app from 2.3.5 to 2.3.8 and there are many spots where previous code was output correctly and now it expects html_safe method
2010 Oct 01
8
field_with_errors.
If a model doesn''t pass validation the field in the view is put under a <div class="field_with_errors">. But who create that div? field_text helper do it? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2013 Nov 08
2
Export CSV
Hi friends, i am using csv export on my application. in my view file code is <%- headers = ["Transaction ID", "Activity ID", "Product Name","Customer Name", "Ticket code"] -%> <%= CSV.generate_line(headers).strip %> <%if !@trans.nil? && @trans.length > 0 %> <% @trans.each do |tran|%> <% if
2006 Mar 25
7
Overriding <div class="fieldWithErrors">
Does anyone know how to override the <div class="fieldWithErrors"> behaviour when a form field is incorrect? Thanks, Dan
2010 Jul 27
13
3.0.0rc ActionController::RoutingError No route matches
Have been developing on 3.0.0beta4 and just updated to 3.0.0.rc. When I try to link_to() a User object that previously had worked, I get the following: ActionView::Template::Error (No route matches {:action=>"destroy", :controller=>"games", :id=>#<User ..... > Yet I have in my routes.rb file has resources :users and my "rake routes" shows:
2009 Oct 06
0
Named routes and a Railscast
I''m looking at railscast#102 ( http://railscasts.com/episodes/102-auto-complete-association ) and when I implement it, a certain named ( "formatted_channelnotes_path(:js)" ) route is used in: <%= text_field_with_auto_complete :channel, :channelnote_name, { :size => 15 }, { :url => formatted_channelnotes_path(:js), :method => :get, :param_name =>
2013 May 13
0
Middleware example from Railscast #151 doesn't work as expected. Need help.
My middleware class "ResponseTimer" doesn''t intercept a request. I don''t know why (the example is from here http://railscasts.com/episodes/151-rack-middleware?view=asciicast; I changed my one a little for Rails 3.2.13 version, the original is for Rails 2.x). So I did as follows: ## in \lib\response_timer.rb ## this is the class of my custom middleware: class
2008 Oct 24
4
Railscast 75, Observe_field and Shopping Cart
Hi all, I have the shopping cart page where a user can add items dynamically through ajax as explained in Railscast episode 75. I am using observe_field to observe the ''quantity'' and ''cost'' fields to update the total field for each item. This does not work however, for records that are added through the Ajax. How can i name the fields and observe them as i have
2011 Mar 10
2
Trying to test flash messaging with rspec
Hello every one, So my this rspec test fails: [code] it "should have a welcome message" do post :create, :user => @attr response.flash[:success].should eql("Welcome new user!") end [/code] However when I create a new user the flash message does display just as I had wanted it to. The controller has this in it: [code] def create @user =
2010 Aug 17
3
Rails 3 flash message problems
The following code in my application_helper.rb class either eats the flash message or escapes it and does not display properly: # Outputs the corresponding flash message if any are set def flash_messages messages = [] %w(notice warning error).each do |msg| messages << content_tag(:div, content_tag(:p, html_escape(flash[msg.to_sym])), :class => "message
2011 Mar 09
1
&quot; instead of " in js code rendered by erb
Having problems rendering javascript in erb file. Thanks for suggestions. //layout erb file (function() { ... var widget_properties = {}; <%= content_for?(:extend_widget) ? "widget_properties = " + yield(:extend_widget) : '''' %> ... })(); //view erb file <% content_for :extend_widget do %> extend = { _init: function() {
2017 Jan 11
0
NUT Client shuts down when performing runtime calibration on APC UPS
On Wed, 11 Jan 2017, Merk - Oliver wrote: > nas4free: /# more /usr/local/bin/upssched-cmd > #!/bin/sh I would strongly recommend specifying which script interpreter is to be used: dash, bash, csh, ksh, ... For example #!/bin/bash There seem to be too many case statements in this script. > case "${1}" in > shutdown-warning) >
2013 Mar 06
2
Refresh a partial onClick using ajax call in rails 3.x
Hi All, I want to refresh a partial onClick, onClick i am making ajax call and getting the data but i am unable to refresh the partial. here is the code IN views: home.html.erb $(document).ready(function() { var currentCellText; $(".inline").click(function() { currentCellText = $(this).text(); $.ajax({ type: ''GET'', dataType: "json",
2017 Jan 11
3
NUT Client shuts down when performing runtime calibration on APC UPS
I've setup nas4free (latest version 11.0.0.4, which has NUT 2.7.4) in a VM and configured it via webinterface to my APC UPS and set "shutdown mode" to "UPS goes on battery" with a timer of 30s. Then I started runtime calibration on the UPS and after 30s nas4free has shut down! I think this is not the correct behavior, since the status was "OB CAL". The system
2005 Feb 07
1
Remote MWI via IAX?
We have a couple of Asterisk boxes with one being the main system with everyone's voicemail and the other a slave used merely to link a couple of remote phones to the main system using IAX. How can one propagate message waiting indication from the main system to the remote phones? g.
2010 May 25
0
Rails 2.3.8 Upgrade Mods
Same problem here but solved! hopefully this is helpful. Solution was to watch Ryan Bates Railscast on Rails 3 XSS, and then to ensure any strings being sent out by my form and custom helpers was HTML Safe => Just look for where the helpers are rendering tags and string and add the ".html_safe" method on the end. Hope this is helpful -- You received this message because you are