Displaying 20 results from an estimated 100000 matches similar to: "Namespaced routes and js.erb"
2008 Nov 18
1
Missing js.erb template
Dear all
I am new to web development, and I am working on some simple ajax
function and got the following error that may need your expert opinions.
Missing template ecpath_app_version/__version_list.js.erb in view path
D:/Ruby/test/ssc_1/app/views
I know there is no js.erb file in app/view/<controller> folder, and I
don''t know what content should be in the js.erb. Are there any
2012 Nov 21
0
What to use //= require_tree or js,css incude tag in application.erb ?
Hi ,
We are using reqiure_tree in our application.js and application.css.
As per i know require_tree include all js and css in application.js and
application.css .
We include application file of both .js and .css in our application.erb.
Q . We include both .js and .css application file in application.erb .
Is including in application.erb, did all .js and .css file are
included in
2011 Mar 09
1
" 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() {
2012 Nov 27
1
controller not rendering existing js.erb file
In my PlaceController, I have a search method, called remotely from a form
the method is executed, but rendering is not executed as the template is
stated as missing ..
but it''s there ...
post :search, :locale => I18n.locale, :format => :js, :country =>
"United"
Error: test_should_search_places(Backoffice::PlacesControllerTest)
ActionView::MissingTemplate:
2011 Oct 12
4
How to access controller's instance variable in a js.erb loaded by javascript_include_tag?
Hello!
In rails 3.1 app I have a controller UsersController with ''show'' action.
show.html.erb contains:
<% content_for(:head) do %>
<%= javascript_include_tag ''myscript'' %>
<% end %>
<p>Hello @user.name</p>
And I have this in myscript.js.erb
$jQuery(document).ready(function() {
alert(<%= @user.name %>);
});
@user is being
2011 Jun 17
0
.js.erb not being parsed by .erb first
I am trying to dynamically include a javascript file based on a
configuration option however I keep getting this error:
Error compiling asset application.js:
ArgumentError: wrong number of arguments (3 for 1)
(in c:/Users/Dieter/Documents/event_calendar/vendor/assets/javascripts/event_calendar.js.erb:1)
when trying to run this code:
//<% require ''event_calendar'' %>
//=
2011 Nov 10
1
url helper in model.js.erb.cofee (Sprockets::Context)
hello,
I am writing a js/coffee file that gets erb handling and I need to use
a url helper inside this file
if write
..
url: ''<%= url_for(:action => :index) %>''
I get an error:
NoMethodError Exception: undefined method `url_for'' for #<#<Class:
0xbdbb068>:0xeed1eb8>
>>self.class
#<Class:0xbdbb068> < Sprockets::Context
How do I
2012 Feb 17
0
Passing a value to js.erb
Rails 3.1.3
I''m trying to pass a value to ''save.js.erb'' .
in the view, I have put
<%= hidden_field_tag "video-id", @video.id, { :id => "video-id" } %>
then, I can retrieve it by
var idval = $(''#video-id'').val();
It certainly gets the value.
The problem is then I need to pass it to the following.
I tried,
2010 Aug 16
8
Executing js.erb file with :format =>'js'
Hi, I''m trying to get my javascript to execute after clicking a link on
my page using :format => "js" here''s my link:
<%= link_to image_tag("/images/icons/user_add.png"),
add_contact_path(:profile_id => profile.id, :url => request.url, :format
=> "js"), :title => "Add person to your contacts"%>
in my controller i have
2012 Aug 29
7
custom js in rails project
Hello, I have a rails project with one controller and one action, as
simple as posible. And I''m trying to put some custom css and js to my
own index.html.erb (not public/index.html.erb), I inluded this on the
layout file:
layout file:
<!DOCTYPE html>
<html>
<head>
<title>Volei</title>
<%= stylesheet_link_tag "application", :media =>
2010 Jun 24
0
Rails3: render_to_string of a .html.erb when request is a json request raises MissingTemplate error
I''ve the following situation (which actually works in Rails 2.3.8 and
this is a result of the migration of our app to rails3):
I have a partial which is rendered a few times (imagine tr''s in a
table). On the clientside there''s a script that does a json request
for a specific row (jQuery + ajax dataType: ''json'' and type: ''POST'')
In
2007 Sep 29
1
templates with same name before extension are cached
Hi all,
I was just wondering if this is the intended behavior. Here is my setup:
controller
def index
respond_to do |f|
f.xml { render :xml => true }
f.html { render :layout => :none }
end
end
In my views I have a file for each type
index.herb
index.xerb
The first request I send is cached and interferes with the other one.
For example, if I send an xml request
2008 Mar 03
4
To use JS in RedBox Plugin
Hi All,
I''m using redbox plugin in my app. Redbox plugin is working properly.But
when i try to change text box values using js its not working.
The Code is
<input type="text" name="playlist" id="playlist_name">
<input type="radio" name="playlist"
2008 Dec 20
4
Accessing rails helpers when processing erb snippets
I need to be able to merge a lot of content for web pages, along with
links to other pages taken from a list of categories. The text that goes
with each category can be different depending on the context that it''s
displayed in.
I could do this by having a whole stack of *.html.erb files which hold
the static content and access the Rails helpers to pull in stuff from
the database and
2008 Dec 25
5
One question about Dynamic Select Menus
Hi all,
Merry X''mas first :-)
I have "Product","Category","Subcategory" 3 Model, and when new
"Product", I want to use "Dynamic Select Menus" just like Ryan
mentioned in http://railscasts.com/episodes/88-dynamic-select-menus
I have everything down. But when I visit the js file, I got following
error
Showing
2009 Mar 03
2
javascript file structure
hi
as far as i know (i''m new on ror) the file structure of javascript files
are:
app/views/posts/...
public/javascripts/*.js
what i understand as a View is final step of the application, the thing
that user see, let''s say...the screen. in this sense, javascript in
some cases, are also -part of- the "view" for some situations.
so, i understand that public/javascript
2008 Mar 12
2
nested routes with a 2-way has_many using join table?
I have two classes, InstructionalObject and Assets. They both have_many
of the other, implemented through a join table (so it''s like a habtm
without the habtm).
For the next version of our app, we''re refactoring to RESTful, and i''m
having trouble with my nested resources/routes. I tried this, in
routes.rb:
map.resources :assets do |assets|
assets.resources
2007 Jan 19
4
Rendering with erb
Hi, I thought it would be fun to try to write a render method that
uses erb for rending. I''m not much of a programmer, but I still like
to try:
module Test
require ''erb''
def render(m)
ERB.new(IO.read("templates/layout.html")).result(binding) do
ERB.new(IO.read("templates/#{m}.html")).result(binding)
end
end
end
This
2007 Jul 22
1
html.erb and textmate. Cant get snippets to work.
Hello!
I moved to html.erb but the snippets fail to work.
eg
.rhtml
lia(tab) gives me link_to
.html.erb
lia with a tab after it =)
I have tried the comment suggested here:
http://ryandaigle.com/articles/2007/2/21/what-s-new-in-edge-rails-rhtml-and-rxml-to-die-a-slow-and-painful-death
David Demaree:
"
1. Select Bundles > Bundle Editor > Edit Languages... from the menu bar.
2. Find
2012 Mar 31
0
Missing Template Error on render_to_string - Rails 3.2.2
Hi,
I''m trying to execute some javascript in the browser after completing
my create action in the controller. Here''s how I''m doing it:
In my controller:
def create
# exectue some code
js = render_to_string(:layout => false, :template =>
"planned_meals/meal.js.coffee.erb")
render :js => js
end
Two questions:
1) Am I going about it the