Displaying 20 results from an estimated 70000 matches similar to: "Content_for & Capture helper"
2010 Jul 13
1
will_paginate destroys link_to_remote?!
Hello,
I''ve got a list in a view and each of element of it has a link_to_remote
and everything worked like a charm. Now I added AJAX pagination and the
link_to_remote doesn''t work anymore.
This is the partial of the list:
<% for character in characters %>
<%= character.name %>
<%= link_to_remote t(''.add''), :url =>
2010 Jan 02
0
Print a PDF directly after prawnto with iframes
Hi,
I think I''m very near of accomplishing this but I have a problem.
This is the code:
<%- content_for :head do -%>
<script type="text/javascript" charset="utf-8">
function printPDF(){
var pdf = document.getElementById("pdfDoc").contentWindow;
pdf.focus();
pdf.print();
}
</script>
<%- end -%>
2010 Jan 20
0
Will_paginate not working with the ajax
Hi,
I am using "will_paginate" for pagination purpose.
I have a partial with name "my_friends", I have a pagination of 25 per
page.
I have added "<%= will_paginate @user_friend} %>" in my partial.
It is working fine. I have a functionality to delete the friend.
So I have usd "link_to_remote" call to delete the friend and I am
updating that partial with
2010 Jul 30
1
pagination
Pagination
I am using an old tutorial which is tripping me right up as I have the
latest version of rails installed. I''m persisting as I think I''m
learning a little bit more about how RoR works. However after installing
the scaffolding plug-in to fix an earlier problem I now have a problem
with the pagination. I have followed this workaround:
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() {
2011 Feb 17
1
Adding images for pagination links in will_paginate
Hi,
I am using will_paginate for pagination.
I have to show only Previous and Next links, that I have achieved by
":page_links=>false" parameter.
Now I want to show the images instead of "Previous" and "Next" labels.
Can anyone tell how to achieve this in will_paginate?
Thanks,
Tushar
--
Posted via http://www.ruby-forum.com/.
--
You received this message
2008 Jan 24
3
Help to spec a rails helper method that uses content_for
Hi guys,
I am a Rspec newbie and am having problems creating a spec for a RoR helper
method.
I have in fact already implemented the helper method and am trying to create
retrospective specs. I know its the wrong way to do it but I am still
learning Rspec.
In my view I have a call to a helper method.
<% body_class "users" %>
which sets a CSS class declaration in the content_for
2008 May 19
0
How to fetch a block provided by content_for in a helper?
Hi,
I got a title_tag helper that renders default page title or title
provided by content_for block, if such block is present. Currently I
call this method like this: "title_tag(yield(:title))". Is it possible
to fetch :title block inside the helper without explicitly passing it
as a parameter to this helper?
--~--~---------~--~----~------------~-------~--~----~
You received this
2010 Jan 31
3
Append/Prepend to a template from controller method
I want a method in app/controllers/application.rb that can
prepend/append text to whatever template gets rendered. Of course I
can''t call render twice w/o getting a double render error, so is this
possible?
I want to redirect after a delay using a meta refresh. Here''s what I''ve
got:
app/controllers/application_controller.rb:
def redirect_after_delay (url, delay)
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
2010 Aug 18
2
RSpec 2/Rails 3 - content_for in view specs
My main layout includes separate content_for/yield sections for my header,
sidebar, footer, and content. However, when running a view spec, the
`rendered` variable seems to only contain a string of just the primary
content and ignores the header/footer/sidebar as well as the rest of my
layout file (the "render" call just returns my primary content wrapped in
generic <html> and
2013 Oct 08
1
Trouble with rspec and FactoryGirl Sequence
I''m following Michael Hartl''s Ruby on Rails 3 Tutorial but I''m using
Rails 3.2.8 and FactoryGirl 4.2.0 and rspec 2.14.1 I''m in chapter 10
trying to generate tests for pagination (using will_paginate 3.2.5 which
works fine in dev)
I can get FactoryGirl to test just fine if I don''t use Sequence but I
can''t seem to figure out the correct syntax
2010 Apr 09
2
dynamically linking to ajax.googleapis jquery
Hi
I am using jquery and jqueryui in my application And in layout I use
<%= javascript_include_tag
"http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"%>
<%= javascript_include_tag
"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" %>
<%= stylesheet_link_tag
2010 Jan 08
1
problem using build with has_many :through relationship
Hello all,
I''m having problems creating a new record with has_many :through
My application is quite complicated so I''ll try to explain it as easy as
I can.
I have a many to many relationship with Projects, IRBs and Reviews.
Where reviews is the joined model.
In the new project view, I have a link (add IRB). This will add an a
list of IRBs to the new project form.
I have visited
2014 Apr 26
0
Ruby on Rails 4.1 - Random SWF backgrounds in layout
Hi Everyone, this is my first post on Ruby on Rails, I've managed to get up
and running with Rails 4.1 on FreeBSD with Nginx and Ruby 2.1.1.
My issue is this:
I have a folder located at /public/swf/ that contains numerous swf files I
want to load as a background for every page of my site. I've successfully
created a controller with a randomize method and a corresponding view that
2010 Jun 02
1
Ajax with JQuery
I have used Ajax link and live validation in index.rhtml
Ajax link requires JavaScript "prototype" and live validation requires
"jquery".
i got "element.dispatchEvent is not a function" on the firebug console
when i used "prototype" and "jquery" in same page index.rhtml
after i removed javascript "prototype" library, i got "Ajax is
2010 Jun 21
4
javascript tabs not working in rails app
This is in application.html.erb:
<script type="text/javascript"
src="../javascripts/application.js"></script>
<script type="text/javascript"
src="../javascripts/jquery-1.4.2.js"></script>
<div id="content">
<%= yield :tabContent %>
</div>
2010 May 05
2
Add method to get at captured content_for
In Rails 3 the only way to get for content captured with the
content_for method in a view is to call yield from within a view.
However, sometimes is it useful to get to this data from within a
helper (for instance to provide a default value). Calling yield from
within the helper method won''t work, and accessing the @_content_for
variable directly is not encouraged.
Proposed solution: add
2010 Oct 02
0
Ajax observe_field not vorking on Rails
down vote favorite
I am trying to create some kind of search in my ruby on rails
application and I want to add ajax support. I want when a user types in
a search box a word, ajax automatically generates the results. And I
have searched almost all internet and I couldn''t find answer to
following question:
When I type into my text area nothing happens. It is like ajax is not
working at
2013 Jan 09
4
CSRF resets my session in Firefox
Hello all,
I''ve been trying to diagnose an issue with CSRF and Firefox
specifically. I''ve got an ajax based form, using UJS (yes, I have
csrf_meta_tag in my layout and I''ve tried adding the X-CSRF-Token header
to the ajax beforeSend events without any luck)... The form just posts
some data to an ajax method that creates, saves, and sets the session
for a shopper as