Displaying 20 results from an estimated 10000 matches similar to: "blocks using concat do not work inside helper"
2007 Nov 10
3
Wrapper Helper Help Please
Hi all. I''m hoping this is a simple one that someone can put me right
on.
I have a view that ''wraps'' some div''s around a Page Header and Page
Content, for formatting reasons:
<div id="LHS">
<div class="Page">
<div class="PageHeader">
''Header Here''
</div>
<div
2007 Mar 15
1
Helper content_tag and Blocks
The content_tag helper allows you to do things like:
content_tag(:p, "Hello world!")
# => <p>Hello world!</p>
It can take in blocks, for functionality like this:
<% content_tag :div, :class => "strong" do -%>
Hello world!
<% end -%>
# => <div class="strong"><p>Hello world!</p></div>
Unfortunately blocks
2007 May 28
2
helper with block compile error
HI,
i''m trying to write a helper that replaces link_to_remote that
accepts a block but it gets a compile error in the template:
I don''t know what I''m doing wrong... TIA
# application_helper.rb
def link_block_to_remote( options = {}, html_options = {}, &block)
concat(link_to_remote(capture(&block), options, html_options),
block.binding)
end
# in
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
2011 Sep 04
4
same html elements rendering twice on page
hey all,
My index.html.haml:
- wrap do
- page_title "Teams List View"
application_helper.rb:
def page_title(title)
content_tag :h1, title
end
def wrap(&block)
concat(content_tag(:div, capture(&block), :class =>
"generic_header"))
end
I load in browser and get:
<div class="generic_header"><h1>Teams List
2007 Dec 09
0
Writing Specifications for Custom Form Builders (and Helpers)
Hello all,
Long time reader, first time poster!
I am a relative newcomer (no idea what on earth I am doing) to Ruby,
Rails and Rspec and have a feeling I am probably trying to run before
I know how to walk.
I had imagined a cool way of outputting a div around some form stuff
which would have a class on it if the related field had errors,
something a bit like:
<%
2006 Jul 13
1
From the Agile book, page 144 regarding a div tag helper
Hi. in the Rails Agile book here''s what was happening:
>>>
module StoreHelper
def hidden_div_if(condition, attributes = {})
if condition
attributes["style" ] = "display: none"
end
attrs = tag_options(attributes.stringify_keys)
"<div #{attrs}>"
end
# format_price method ...
end
Note that we cheated slightly here. We copied code from the Rails
2006 Sep 11
2
Compilation Errors
Hey there,
I just updated to ferret 10.0.4, and acts_as_ferret 0.3, and now when I
try to run my app with mongrel on Windows, I get very strange compile
errors:
ompile error
C:/rails/app/script/../config/../app/views/login/index.rhtml:8: Invalid
char `\002'' in expression
C:/rails/app/script/../config/../app/views/login/index.rhtml:9: syntax
error
_erbout.concat "
2012 Jul 19
2
Problem with puppet-concat
Hi
I am developing a module to create a simple nas for my work and I am using
the concat module to assemble /etc/exports and /etc/samba/smb.conf.
I developed my module on my puppet development server and concat worked
like a charm, however when I rolled it out to my live servers if kept on
failing with the following error:
err: Failed to apply catalog: Could not find dependent
2006 Dec 05
1
Using render inside a FormBuilder (EdgeRails)
I''m using the latest trunk of 1.2-ish, and I''m wondering how to do what
I want to do. I am using a form_for :builder I wrote, simply called
TableFormBuilder after the rails cookbook, and want to be able to
present help icons automatically. I want these icons to appear next to
form fields I am rendering.
For example, I have this method in helpers/table_form_builder.rb:
# This
2006 Feb 07
3
Newbie help ..
Hi ..
I am new to Rails and it is not clear to me why I am getting the
following error. Any help appreciated.
-m.
$cat app/views/admin/new.rhtml
<% @page_title = "New member..." -%>
<%= start_form_tag( :action => ''create'' ) %>
<table>
<tr>
<td> First Name: </td>
<td> <%= text_field(
2013 Jan 09
0
concat and ordering
I''m attempting to work with the puppetforge haproxy module.
The module uses concat and I get how it works, but I''m having some problems
with the sequencing.
What the module does is:
For the listener:
order => "20-${name}" // ${name} is the name of the listening service
For the balancermember
order => "20-${listening_service}-${name}" //
2007 Jan 25
2
Need help for Helper
I need a helper, which will render a table in my customized style.
I wrote a code like this:
template.rhtml:
<% @column_names = ["Name", "Age", "Sex"] %>
<%= table_show @column_name %>
helper.rb
def table_show(names)
for name in names
content_tag ( :div, name, :class => ''table_header'' )
end
end
Which should give me an output
2006 Apr 04
2
Syntax Error in find()
Maybe I misunderstand the parameterization of find(), I am getting this
syntax error for
<% @choices = Choic
e.find(:all, :conditions => "question_id" = question.id, :order =>
"order") %>
---- ERROR LOG ----
ActionView::TemplateError (compile error
../config/../app/views/admin/test/show.rhtml:37: syntax error
_erbout.concat " "; @choices =
2007 Sep 19
0
Error with special characters(?)
Hi,
I am having a strange problem.
I have RoR 1.7 installed and a have a HTML page (View) with the folowing
part of code:
<% types = ["AF1", "ALéEL", "AE pé", "CET"]%>
The element of the 2nd index ("AE thé") is causing me problem. The fact
is since the last letter of the string is a special character ("é"), i
have the following
2019 Aug 27
3
[Bug 1360] New: BUG: invalid expression type concat on invalid input "iifname . oifname p . q"
https://bugzilla.netfilter.org/show_bug.cgi?id=1360
Bug ID: 1360
Summary: BUG: invalid expression type concat on invalid input
"iifname . oifname p . q"
Product: nftables
Version: unspecified
Hardware: x86_64
OS: Debian GNU/Linux
Status: NEW
Severity: normal
2012 Jul 23
0
Updated version of pupmod-concat released to Github
A long overdue update to pupmod-concat has been released to Github at
https://github.com/onyxpoint/pupmod-concat.
It contains fixes for all outstanding bug reports as well as some
additional optimizations and features.
Many thanks to all bug reporters and we''re going to try to not wait
another year before fixing new issues!
Thanks,
Trevor
--
Trevor Vaughan
Vice President, Onyx
2003 Nov 22
0
append or concat for dhcp-parameter-request-list
I'm confused...
A few months back I was playing with sending information to pxelinux by forcing the dhcp server to send certain options. I couldn't get the syntax:
append dhcp-parameter-request-list 208,209,210,211;
to work, but I was able to get
option dhcp-parameter-request-list = concat(option dhcp-parameter-request-list,d0,d1,d2,d3);
to work. This was with 3.0.1pl9.
Now with
2007 Feb 12
1
Invalid char problem
Has the problem with corrupted .rhtmls (invalid characters) been solved
so far?
I would like to use ferret and acts_as_ferret on Windows XP. I have
installed 0.10.9 (mswin32) which still seems to have the problem.
I am receiving error messages like:
compile error
C:/INSTAN~1.4P1/INSTAN~1/rails_apps/travelogue/config/../app/views/article_editor/_header_read.rhtml:2:
parse error, unexpected
2006 Mar 11
4
Live search in Rails
Hi i''ve been trying to implement live search on rails but Im having
trouble Im using a tutorial at:
http://www.joestelmach.com/blog/live_search_with_ruby_on_rails
But im getting a syntaxerror on line 1
''1: <% if @items && @items.length > 0% >''
I cant fathom what im doing wrong, is that line calling a column in
my database called items?