similar to: ERB and binding in template

Displaying 20 results from an estimated 30000 matches similar to: "ERB and binding in template"

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:
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
2011 Mar 02
3
haml to erb - does it work with new html5 tags?
Hi, I wanted to covert all my erb over to haml, but I use HTML5 tags like nav, section, article, etc. Any idea if this is supported by haml? Checked out their site, nothing mentioned there or did I miss something. Sorry noob here. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
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 Nov 01
2
Railscast 262 different partial in helper
Hi RoR Community, in Ryan Bates Railscasts Episode #262 he put the index code <% for message in @messages %> <div class="message"> <div class="created_at"><%= message.created_at.strftime("%B %d, %Y") %></div> <div class="content"> <%= message.content %> </div> <div
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 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
2012 Apr 24
3
How to increment variable in erb template ?
Hi'', I''m looking for a way to increment variable in template (erb file). I tried this, but it didn''t work Compteur <%= compteur %> > <% compteur = compteur + 1 %> > Compteur <%= compteur %> > I''ve got this error : > Error 400 on SERVER: Failed to parse template test/test.erb: undefined > method `+'' for
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
2010 Mar 09
3
undefined method join for STRING error
Hey all, I was converting a haml file to erb and when finished, I ran the app and got this error message: NoMethodError in Students#student_fail Showing app/views/students/student_fail.erb where line #40 raised: undefined method `join'' for #<String:0x105a5e0c8> Extracted source (around line #40): 37: 38: <% fields << render(:partial =>
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
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
2006 Jun 27
5
Can''t call public application.rb method from ERb template
All, I have a left navigation partial that I want to dynamically generate CSS classes for based on the current controller action. In my ERb template, I have <DIV class="<%= get_menu_display_style(''login_form'') %>"> In application.rb, I have the method get_menu_display_style defined as: public def get_menu_display_style(action_requested)
2011 Mar 09
1
&quot; 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() {
2010 Sep 07
2
Help on formatting some HAML
I wondered if anyone could help me with turning the following in ERB into HAML. I''m VERY new with HAML: ---- <div class="block-element span-7 colborder"> <span class="rightside blue-hue no_decor"><%= link_to "New Order", new_order_path, :remote => true %></span> <h3>Today''s Activity</h3> <hr>
2012 Mar 28
1
collection_select
_form.html.haml = f.label :Select_Brand, "Select_Brand<em>*</em>".html_safe = collection_select(:brand_name, :brand_id, Brand.all, :id, :name, :prompt => "Select a Brand" ) show.html.haml file %table %tr %td Brand_Name : %td = @message.brand_id After writing this code I am not able to see the brand name. Its not giving any error but
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
2012 Aug 04
1
string matching in erb template
Hi! I am trying to match a string in an ERB template but for what ever reason it does not work. <% if has_variable?("apache2_phpmyadmin_url") && apache2_phpmyadmin_url != "" then %> ProxyPass /<%= apache2_phpmyadmin_url %>/ ! <% end %> The conditional works on has_variable? but the != "" is not getting evaluated. When the
2011 Oct 29
2
comments on HAML ?
I have been asked a couple of times at job interviews if I am familiar with HAML or Liquid so I was wondering if maybe I should start using them and perhaps it would make the views easier to work with. If I install HAML on a machine where my app is that has alot of regular HTML in the .erb views already, will it still work with those or do I need to convert everything to HAML ? Can I have some
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