Displaying 20 results from an estimated 100000 matches similar to: "How to change template rendering order?"
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:
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
2010 Aug 28
0
Rails 3 rendering XML problem
I have Rails 3 application (running Rails RC1), and I have the following
controller:
class PluginsController < ApplicationController
respond_to :html, :xml, :json
def index
@plugins = Plugin.all
respond_with(@plugins)
end
end
If I try to render http://localhost:3000/plugins it works fine, showing
me the HTML version. If I try to get http://localhost:3000/plugins.json,
it also
2010 Aug 19
0
Camping 2.1 - ERB, Haml, 1.9, bug fixes, new website!
{}
||
||
~~~~~~~~~~~~~~~ <= _whycake
~ Camping 2.1 ~
~~~~~~~~~~~~~~~
I''m pleased to announce another release of Camping, the microframework. This
time we''ve focused on improving the 1.9 support, adding (builtin) support for
more template engines, refreshing the homepage and just general bug fixes.
gem install camping
Home:
2008 Sep 25
0
Rspec, HAML with view testing
Hi all,
Has anyone experienced the following problem testing rspec against
haml views
Attempting to run a view spec (partial)
app/view/users/_foo.html.haml
it "should render it" do
render :partial => "users/foo", :locals => template_locals
end
The following error is returned:
1)
ActionView::MissingTemplate in ''shared/_jar_layout should render
2008 Sep 24
0
Rspec, HAML, view testing
Hi all,
Has anybody experience the following problem running testing rspec
against haml views
Attempting to run a view spec
app/view/users/_foo.html.haml
it "should render it" do
render :partial => "users/foo", :locals => template_locals
end
1)
ActionView::MissingTemplate in ''shared/_jar_layout should render it''
Missing templatet
2008 May 30
0
Template localization
Hello,
I''m writing an app that needs a simple localization system. I thought
it would be enough to have localized templates (like rendering
show.en.html.haml when the requested action is show and the current
locale is set to en) without all the complex features that i18n
plugins have.
Since I was unable to find a plugin that works on edge I decided to
write some code on my own. I think
2008 Feb 15
2
HAML question - conditional multiple classes on a div
I am looking into HAML and am trying to convert one of my ERB templates to
see what I think of it. Everything was going pretty well until I got to the
following snippet:
<div class="<%= t.done ? "task done": "task" %>">
<p class="title"><%= h(t.description)%></p>
</div>
How would you do this in HAML? (I know how to
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
2010 Oct 20
7
How can I render a template outside of a controller in Rails 3?
Hi All,
I can''t seem to render a template outside of a controller in my Rails 3
application. The googling I''ve done has been helpful, and I eventually found
some useful info at
http://www.swombat.com/rails-rendering-templates-outside-of-a-contro.
However, this seems to be broken in Rails 3. Does anyone have any ideas how
I can fix this method or perhaps know of a better
2006 Mar 12
0
ERB and Builder template engines shouldn''t be so heavily wired in ActionView::Base
Problem:
1. ERB and Builder template engines are heavily wired in ActionView::Base
2. Should be optional. If we use different engine - why load all their
stuff if not needed?
3. There are template engines which expect files in their own locations
and cache them in their own way. For instance a template engine may
store templates in a database. These engines don''t need any central
source
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 Oct 24
1
Status of Merb on JRuby
I''ve submitted a few patches on Trac to help get Merb running under
JRuby [0][1][2][3][4]. It''d be cool if any of you committers could
find the time to look them over and apply/reject them. They''re mostly
tiny, so it shouldn''t be too onerous.
With all of these patches applied, there are still 3 spec failures.
One is in the spec ''a merb mailer
2008 May 29
2
Render partial yields "dynamic constant assignment"
I''m getting a syntax error when rendering a partial. This is a simple
html partial with one instance variable inside it. Rendering as a
"template" instead of as a partial works just fine. The error occurs 3
lines after the last line of HTML code in the partial. There is no line
72! Here is the error:
SyntaxError in Building_blocks#preview
Showing
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 18
2
Render a view from console
Hello!
In my application I''m trying to render a view from a class in /lib
folder. I have found that it''s very similar to render a view from
console. So, I have tried different methods:
>> string = ActionView::Base.new.render( :inline => ''works'', :layout => false )
=> "works"
>> string = ActionView::Base.new.render( :template =>
2009 May 20
1
templating language questions
Hello,
I''m experimenting with a xhtml templating language and have some
questions about ActionPack, particularly to do with compilable
templates. I''m mostly looking for further information about compilable
templates.
The templating language currently works, though it isn''t a compilable
template handler. I''ve yet to benchmark it, but it seems to be running
2007 Aug 29
11
Non-Erubis Templates
Trunk Issue: Because of the use of ''autoload'', template handlers other
than Erubis are not loaded automatically (Haml, XMLBuilder). Either
this should be fixed, or the documentation should be updated to
instruct people how to use non-Erb template engines.
Apparently the solution is to do something like this in merb_init.rb:
::Merb::AbstractController.register_engine
2011 Aug 31
0
ERB and binding in template
How to get current binding in a partial (to use helpers and local
variables in erb script)?
When I invoke result whithout binding,
= ERB.new("script").result.html_safe
all work (without vars are needed), but when I write
= ERB.new("script").result(binding).html_safe
(in HAML HTML partial), THE PARTIAL''S REST OF OUTPUT IS CLEAR.
What is the problem?
--
Posted
2009 Apr 14
6
About haml and ruby on rail
hi all,
I am converting my view into HAML format i have done it with
"Html2Haml" command, then I removed all the "- end" from haml code and
my indentation is also correct,but now it shows following errors
I have kept code of show.html.erb and show.html.haml in attachment.
please help me I am not getting what exactly the error is?
compile error