Displaying 20 results from an estimated 6000 matches similar to: "how to access ActionView::Helpers::JavaScriptHelper::escape_javascript in a model (a newbie question)"
2009 Sep 04
2
escape_javascript error
Hello,
I am using jQuery for all ajax stuff and recently got following error:
ActionView::TemplateError (private method `gsub'' called for #<Array:
0x2425ae8>) on line #1 of...
and the code where it happens:
$("#notice_ajax").before(''<div id="notice_ajax"><%= escape_javascript
(flash.delete(:notice)) %></div>'').remove();
2010 Dec 21
8
Rails - escape_javascript without all the \n\n\n\n\n
Hello, I''m using escape_javascript to return a partial to the browser
via ajax.
Something like:
$("#inject").html("<%=escape_javascript(render :partial =>"feed/
index")%>");
Problem is escape_javascript ends up outputing all kinds of wasted
space like
\n\n\n\n\n \n
Is there anyway in Rails to escape_javascript more
2011 Jun 08
1
Problem with escape_javascript in 3.0.9rc1
Specifically, this does not work!
$("#lightbox_content").html(''<%= escape_javascript(render(:partial =>
"form")) %>'');
Is this the correct way to do JQuery html replacement using a
partial? This works fine in 3.0.7.
Tony
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to
2006 Mar 15
2
link_to_remote issue after upgrading to rails 1.0
Hi
I''ve only recently noticed my notebook was using an old version of rails
(0.13), and so upgraded it to 1.0 (this is on gentoo linux).
The upgrade has broken some previously working code, and I''ve not been
able to find a work-around.
Previously the following call:
<%= link_to_remote("some string",
:update =>
2011 Sep 10
4
Finding HTML attributes with jQuery in Rails 3.1
I''m having trouble wrapping my head around the proper syntax to have
jQuery (in an .js file) grab an HTML attribute and use the value of
that attribute to load a partial.
HTML fragment:
<a href="/toggle" data-remote="true" section="training">
jQuery string (now setting a static partial, I need this to be
dynamic)
2006 Sep 04
1
Overriding ActionView::Helpers::InstanceTag::DEFAULT_TEXT_AREA_OPTIONS
What is the best way to override some of the FormHelper default
options? Right now I''m adding this to the beginning of my
environment.rb:
ActionView::Helpers::InstanceTag::DEFAULT_TEXT_AREA_OPTIONS = { "cols"
=> 80, "rows" => 5 }
Is that the way it''s supposed to be done?
--~--~---------~--~----~------------~-------~--~----~
You received this message
2006 Feb 10
2
How do I test actionview helpers in the console?
I would like to see the output of actionview helper methods, to be able
to play with it.
When I do the following in the console:
collection_select("job", "client_id" , @clients, "id", "name")
I get:
NoMethodError: undefined method `collection_select'' for
#<Object:0xb7cf1970>
I''d like to get something like:
<select
2006 Jan 13
0
testing Helpers
[I''m reposting this. The subject wasnt complete and misleading in my
initial post (''testing'')]
I''m looking for a good way to make all of Rails'' inbuilt helpers
available to my custom Helper while I''m testing it.
The Helper I''m testing is EditorHelper. EditorHelper itself relies on
some of Rails'' inbuilt Helpers, such as
2008 Mar 06
1
Unitialized constant ActionView::Helpers::TagHelper::Set
Hi all,
I write the following test to a simple plugin
require ''rubygems''
require ''test/unit''
require File.dirname(__FILE__) + ''/../lib/meta_tags''
require ''action_view/helpers/tag_helper''
class MetaTagsTest < Test::Unit::TestCase
include MetaTagHelper
include ActionView::Helpers::TagHelper
.
2006 Feb 09
2
#3775 - testing helpers which use ActionView methods
http://dev.rubyonrails.org/ticket/3775
I''m hoping someone will pop up and tell me I''m simply daft with this
ticket (and queries on IRC, and a prior post to the main Rails list),
but I can''t get a peep out of anyone so far.
The question is, how do I write a simple test for a helper method which
calls ActionView methods itself. E.g., a foo_link() helper which calls
2006 Apr 08
2
ActionView::Helpers::FormHelper instance methods should take an object reference rather than an object_name.
Hi
ActionView::Helpers::FormHelper methods (e.g. #text_field,
#check_box...) take object_name as an argument. From this argument
they infer a name that is supposed to contains the reference to the
relevant object.
I can''t see why the FormHelper methods were designed that way.
Compared to simply passing them a reference, the current way seems too
complicated and an invitation to problems
2008 Jun 15
11
[PATCH] helper to create fb css stylized table
I attached a rails helper implementation of the fb_table described here:
http://wiki.developers.facebook.com/index.php/Facebook_Styles
I included testing and comments. I hope you find it useful.
Curiously, it''s really a small extension of FBML.
Richard
-------------- next part --------------
Index: test/rails_integration_test.rb
2009 Apr 09
4
uninitialized constant ActionView::Helpers::AssetTagHelper
Hi All,
I just wiped out my hard drive, did a fresh install of os x 10.5, and
upgraded to rails 2.3.2. i installed the mysql pkg for os x, and
created the databases i needed for the project i was working on before
the upgrade.
However when i run rake db:migrate to run my migrations i get this
error
uninitialized constant ActionView::Helpers::AssetTagHelper
I''ve found some stuff about
2013 Feb 28
1
Make `ActionView::Helpers::InstanceTag#tag_id`, `ActionView::Helpers::InstanceTag#tag_id_with_index(index)` public?
As I asked in StackOverflow<http://stackoverflow.com/questions/15127658/hoe-to-get-tag-id-from-a-record-in-form-for/15129741>
I think it would be helpful since we can dynamically create javascript code
to control each input tag in form helper, what do you think? Or there has
already been a solution?
--
You received this message because you are subscribed to the Google Groups "Ruby
2012 Feb 29
4
how to use link_to with :remote=>true in rails 3.2.1
I m using Rails 3.2.1. how to use link_to with remote=>true
--------------------------------------------
My Method in Controller
def clickme
@clk = "you click me"
respond_to do |format|
format.js { render :layout=>false }
end
end
--------------------------------------------
My View
In my new.html.erb file
<%= link_to "click here",
2011 Jun 15
5
rails 3.0.9
Today was expected the new stable rails release 3.0.9 with some fixed,
among all the problem with escape_javascript.
It seems that it see that has not been released, unfortunately.
--
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
2005 Aug 17
5
asynchronous Ajax.Updater
I had one point in my project where I needed a synchronous Ajax call; in
other words, I wanted the Ajax.Updater call to not return until the content
of my page had been updated. However, I found that if you call
Ajax.Updaterwith the {asynchronous: false} option, the onComplete()
function would never
be called and your content would not be updated. Was this the intended
behavior? I added the
2006 May 04
1
Instance or local vars for field helpers in partial template
I''m getting confused.
If I have a view (.rhtml), I can use a field helper like:
<%= text_field :mymodel, :attribute %>
This uses the value from @mymodel.attribute
Now, if I am rendering a template normally (i.e. not partial), I would
expect @mymodel to be a model object defined as an instance variable in
the controller.
However, if I am rendering a partial template, I
2011 Nov 29
1
ajax question
Hello,
could you please explain what''s wrong with this code:
Rails 3.1.1
skills_controller.rb
class SkillsController < ApplicationController
# GET /skills
# GET /skills.json
def index
@skills = Skill.all
respond_to do |format|
format.html # index.html.erb
#format.json { render json: @skills }
format.js
end
end
end
index.html.erb
<%=
2011 Jan 22
1
uninitialized constant ActionView::Helpers::TagHelper::ERB (NameError)
I am a new to ruby and rails and am trying to refactor some code with
rspec and have run into a problem that has stumped me for a few days and
I have searched google and ruby/rails forums to no avail so I really
hope somebody can help me out with this problem which I think may be
caused by a rails config problem. Anyway, I used ''rails new myapp'' to
make a new rails project and