Displaying 20 results from an estimated 7000 matches similar to: "best-practice for programmatically using rxml generated from controller/view? (or 'how can I view a view from a model')"
2008 Apr 20
1
Why is respond_to always rending the RXML view?
I''m having a problem in Rails 2 where respond_to is always rendering the
RXML view even in the HTML rendering response. Can anyone tell me why
this might be happening? Here''s a code snippet:
respond_to do |accepts|
accepts.html
accepts.xml { render :action => ''show.rxml'', :layout => false}
end
If I change this to the following it works fine:
2005 Nov 03
1
Builder / rxml views: hyphens in XML element names
I''m having a strange problem with an rxml view - it won''t let me put hyphens
in the names of XML elements.
The original problem line was:
xml.VISA-SSL do
But in any other place, if I insert a hyphen into the name of any arbitrary
element, I get the following kind of error:
undefined method `theTextAfterTheHyphen'' for #<#<Class:0xb7617180>:0xb7616f28>
2006 Feb 18
1
Should assert_tag be used to test rxml views?
I''m getting strange errors attempting to test an rxml view with
assert_tag. I can see that what the view is producing is correct but I
get an error like "ignoring attempt to close foo with bar" (where bar is
a tag which is meant to be nested in foo). Is asssert_tag meant for xml,
or just html?
Cheers, Robert.
--
Posted via http://www.ruby-forum.com/.
2006 Dec 12
2
RXML partial question
All,
I have a RXML template which renders partial RXML templates within it.
A snippet is below. The "xml" variable is the parent template''s Builder
variable. It is passed into the partial under the name "parent_xml".
Why can''t I use :locals => {.... :xml => xml ....} in my call to render
the partial? It seems like if I do use :xml => xml, it
2005 May 01
5
Example using Builder::XmlMarkup and .rxml files?
Greetings,
I''m a newby to both "R"s in RoR. I would like to use Builder::XmlMarkup
to generate my pages. If there is a working downloadable example
somewhere, that would probably be enough. Otherwise, here''s what
I want to do:
With the following controller:
class AccountsController < ApplicationController
layout ''accounts''
model :account
2006 Jul 14
2
how to get builder 2.0 to escape attributes in rxml
I am using rxml to produce opml files and need to escape ampersands in
the attributes.
builder 2.0 docs found at http://builder.rubyforge.org/ show the
following
xml = Builder::XmlMarkup.new
xml.sample(:escaped=>"This&That", :unescaped=>:"Here&There")
xml.target! =>
<sample escaped="This&That"
2006 Aug 30
1
Shouldn't rxml files be exempt from layout by default?
RJS templates are the only template type that are exempt from layout
by default.
Don''t you think it makes sense to add rxml to the list of exempt
extensions? I''d assume most people would be surprised to see their
XML embedded in the middle of their (most probably) rhtml layout.
http://dev.rubyonrails.org/svn/rails/trunk/actionpack/lib/
action_controller/base.rb:
2005 Apr 13
2
render_partial & RXML
Does render_partial work within a RXML file? I am attempting the following:
xml.users do
for user in @users
render_partial ''user'', user
end
end
All that is output is:
<user>
</user>
Without any exception or anything to indicate that I''m doing something
wrong. Does anyone have any experiece with this?
Josh
2006 Jul 20
2
Why is my rxml view being wrapped by the rhtml template in views/layouts?
Why is my rxml view being wrapped by the rhtml template in views/
layouts?
I was experimenting with REST, I had a nice little test program with
one table: ''resources''. Here''s what the show method looks like:
def show
@resource = Resource.find(params[:id])
respond_to do |accepts|
accepts.html
accepts.xml
end
end
I have a show.rhtml
2006 Mar 04
13
Using helpers from controllers ?
There is a solution to use helpers from controllers ?
I have an error :
|undefined method `content_tag''|
class ApplicationController < ActionController::Base
def test
return content_tag("a","test")
end
end
2006 Mar 28
5
combining two models in one controller/view "set"
I''m going to take another stab at this question (my first one received
no replies):
I have two models:
Author
has_many: books
Book
has_one: author
I have two tables:
authors
id
...
books
id
author_id
...
I let the scaffolding fly and it created the CRUD goodness for each
model, as expected.
However, I want to have only one view/controller "set" for both
models; when I
2006 May 24
5
rxml vs rhtml
I have been wondering if anyone here knows which format is faster for
your templates? I am curious cause in the near future I may be using
some expensive scripts (timewise) and would like to try and squeak out
as much performance as possible. Is Ruby like other languages (ASP
classic for example) that inccur a penalty by switching between HTML and
Ruby Code?
Ben
--
Posted via
2006 Jul 12
1
RXML returns a blank page
Hello,
I built a simple rxml page that should print the contents of a table in XML.
It works perfect localy, using Mongrel.
But I have a VPS server with the same data, but running Lighhtpd.
There, it returns a blank page....
Is it because of mongrel/lighttpd ? How could I fix that ??
Thanks,
Parra
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 May 30
2
No rhtml, rxml, rjs... problem with Action Mailer, again
Hi all
I have seen a lot of people writing my same problem but I haven''t found
the solution yet. This is the problem:
"ActionView::ActionViewError in Periodico#index
No rhtml, rxml, rjs or delegate template found for..."
when trying to send email through action mailer.
I have created the Notifier.rb model (in app/models/ folder)
def signupthanks(user)
# Email
2006 Feb 02
1
actionmailer - No rhtml, rxml, or delegate template
I''m getting this error when I try to send an email.
No rhtml, rxml, or delegate template found for signup_thanks
But I do have signup_thanks.rhtml in app/view/notifier
This is in the notifier model.
class Notifier < ActionMailer::Base
def signup_thanks(sent_at = Time.now)
@subject = "the subject works!"
@body["first_name"] = "first name"
2006 Jun 08
1
No rhtml, rxml, or delegate template found
hi ,
i''m having a problem with rendering a partial , the partial is in the
apps/view/polls folder with the name : _antwoorden_user.rhtml
in the view i''m rendering it with
<% if @user %>
<%= render :partial => ''polls/antwoorden_user'', :locals => {:poll =>
@poll, :user => @user} %>
<% else %>
....
gives me the error =>
No
2006 Aug 03
5
DRYing up the view
Hello everyone!
I have generic views for CRUD operations
For example I render(''shared/list'') from controller
shared/list.rhtml
...
<% for item in @list %>
<tr class="<%= cycle ''list-line-odd'', ''list-line-even'' %>">
<%= render :partial => ''item'', :locals => { :item => item } %>
2007 Jul 31
1
RXML: <ruby:put expr="1+2"/>
Hello
railers,
I''ve always been annoyed by the fact that ERB doesn''t respect XML
specs.
As I mostly write XHTML, I''m trying to write a renderer using only
valid
XML files. Here is an example of a file so you get the feeling of
what
it''s going to
do:
<?xml version="1.0" encoding="utf-8"?
>
<html
2006 Aug 11
3
General architechture / MVC question
Hi all,
A newbie with Ruby on Rails - and programming in general - I''m working
on a few Flash and PHP projects as well. Partly to make my work more
efficient, partly to gain a better understanding of system architecture
/ design patterns, I''ve been trying to use the MVC pattern in
database-backed Flash / Actionscript development as well.
I think / hope that I''m
2006 Jun 09
4
View into a String?
I''ve got a nice XML view of my data that works just fine when I call it
from the browser. Now I''d like a different controller method to take
that XML and write it to the file system. Since the XML view lives in
an RXML file, is there a trick to telling the controller "Get your
output into a string" instead of writing it back to the browser? After
writing it out