Questions tagged [actionview]

For questions about Action Views, HTML and Ruby templates used in Ruby on Rails

HTML and Ruby templates used in .

Action View is the View part of for , and is a part of the Ruby-On-Rails Action Pack.

490 questions
6
votes
3 answers

Rails: execution expired on time_zone_select

The following exception comes up intermittently: An ActionView::Template::Error occurred execution expired vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' This is the full…
Alex Ghiculescu
  • 7,522
  • 3
  • 25
  • 41
6
votes
3 answers

Internal server error 500 on missing image file (Rails 3.2.12)

If we request a bogus image file, Rails generates an internal 500 server error instead of a 404. See the log below. Here is the line in routes.rb that catches 404s: # Catches all 404 errors and redirects match '*url' => 'default#error_404' Other…
Crashalot
  • 33,605
  • 61
  • 269
  • 439
6
votes
3 answers

Hide menu items when ActionLayout is opened

I am using ActionBarSherlock: There are 3 menu items, of which only 1 has an ActionLayout. default_menu.xml
Archie.bpgc
  • 23,812
  • 38
  • 150
  • 226
6
votes
1 answer

undefined method `render' for class `ActionView::Base'

When I start the application crashes following error /home/stereodenis/.rvm/gems/ruby-1.9.3-p194@nyanya/gems/haml-3.1.6/lib/haml/helpers/action_view_mods.rb:15:in `alias_method': undefined method `render' for class `ActionView::Base'…
stereodenis
  • 3,618
  • 2
  • 22
  • 27
6
votes
3 answers

Rails mountable engine and overriding another engine

I'm in the proces of converting my standard Rails app to an mountable engine. The app is comparable to a standard blogging app and i want every model, controller and view to be extendable hence my choice for a mountable engine. One of the gems i use…
Harm de Wit
  • 2,150
  • 2
  • 18
  • 24
6
votes
5 answers

Rails: Preselect a value in ActionView-Helper 'collection_select'

I'm trying to get the ActionView-Helper collection_select to take a value that will be preselected in the dropdown-menu. Neither (:selected in the html-option-hash) <%= collection_select(:my_object, :my_method, @my_collection, :id,…
Javier
  • 2,491
  • 4
  • 36
  • 57
5
votes
1 answer

Rails partial template using a custom handler is escaping html

I'm working on a Rails 3.1 app using JavascriptMVC and ejs templates within the client to do some complicated features on my application. Unfortunately ejs syntax is very similar to erb syntax, to the point where I can't keep the code in the same…
Tony Dorie
  • 114
  • 7
5
votes
2 answers

Rails 3.1 template handlers

I have a ruby gem, poirot, which enables the use of mustache templates in Rails. The template handler I have was extending from ActionView::Template::Handler, however this appears to be deprecated in Rails 3.1. I have re-factored the handler to…
Oliver Nightingale
  • 1,805
  • 1
  • 17
  • 22
5
votes
1 answer

Rails 3: User input escaping working differently in views and mailer

I'm using the following set of code in both my views and the mailer: <%= simple_format(auto_link(h(user_input))) %> I begin by calling html_safe (h) on the user_input, in order to escape any dangerous code. I then call auto_link to enable any links…
William Jones
  • 18,089
  • 17
  • 63
  • 98
5
votes
1 answer

no intent to view jpg on honeycomb?

Here's a bit of code which works fine on phones: Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setDataAndType(IMAGEURI, "image/jpg"); startActivity(intent); which on Honeycomb (3.0 and 3.1) throws…
Jens Zalzala
  • 2,546
  • 1
  • 22
  • 28
5
votes
1 answer

Why does submit_tag generate HTML with the name="commit" property?

As per the rails docs, using the submit_tag helper will generate something like submit_tag # => It includes the property name="commit" Why does this get included? Is it some sort of…
user2490003
  • 10,706
  • 17
  • 79
  • 155
5
votes
1 answer

Missing template error in Rails 4 when requesting format */*;

I've been seeing these errors for a long time but haven't found an issue: ActionView::MissingTemplate: Missing template pages/home, application/home with {:locale=>[:en], :formats=>["*/*;"]} The user agent is always MSIE6 (which is part of the…
ben
  • 1,432
  • 12
  • 17
5
votes
4 answers

How can I test views in a Rails plugin?

I'm writing a Rails plugin that includes some partials. I'd like to test the partials, but I'm having a hard time setting up a test that will render them. There's no associated controller, so I'm just faking one: require…
James A. Rosen
  • 64,193
  • 61
  • 179
  • 261
5
votes
2 answers

Using Rails form helpers on non-existent methods

Normally, when using form helpers in Rails, each field directly correlates to a method on the appropriate object. However, I have a form (user signup) that needs to include fields that are not part of the user model itself (for instance, card…
Neil Middleton
  • 22,105
  • 18
  • 80
  • 134
5
votes
1 answer

Rails form with multiple nested models causes issues with radio groups

I'm having a problem with nested model forms that contain radio buttons, when I have multiple models all the radio buttons are treated as being in the same group. My model contains a has_many relationship like this: class Order < ActiveRecord::Base …
roryf
  • 29,592
  • 16
  • 81
  • 103