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
10
votes
3 answers

Using rails_admin with rails_api

I originally posted this as an issue on rails_api GitHub, but am now posting it here due to inactivity. I'm trying to use rails_admin with a Rails 5 API application. I included extra ActionController modules up to the point that I can either have a…
richard
  • 14,050
  • 8
  • 37
  • 39
10
votes
5 answers

How to access a Rails controller view context from outside of a controller?

I am working on cleaning up some code that relies on some custom controller helper methods, by creating a "plain old Ruby" presenter object. In my controller, I am able to pass the view context to the class: def show # old code:…
Andrew
  • 227,796
  • 193
  • 515
  • 708
9
votes
4 answers

Rails - Date time select in specified time zone

I'm working with an app for a concert tour website, where all times (announcement times, on-sale start times, and event start times) are local to each particular venue's time zone. I take the user entered date/time where applicable and run a…
9
votes
3 answers

Rails3 button_to is calling POST action, trying to call PUT action

I have a button_to that I want to perform a PUT action (there is only one thing that can be updated about this resource - it will be updated as being 'acknowledged', so there are no other form fields associated with firing the action). This is in…
pakeha
  • 2,480
  • 3
  • 22
  • 24
9
votes
4 answers

Display Page Load Time in Rails 3

How can I display the page load time in the view, similar to how the log file shows "Completed 200 OK in 19ms (Views: 16.8ms | Models: 0.497ms)"
Mark Richman
  • 28,948
  • 25
  • 99
  • 159
9
votes
2 answers

Rails: Not reloading engine's view path in development

I have a Rails project which uses an engine, and I am experiencing an issue when working in development mode. Whenever I make some change to something in my project, the application cannot find anymore the engine's views. Missing template…
finiteautomata
  • 3,753
  • 4
  • 31
  • 41
8
votes
3 answers

Passing ActionView::Helpers::FormBuilder to a partial

I am atempting to dinamically create form elements given a certain AJAX request. This is my setup: View: <%= link_to 'Next', check_unique_id_students_path, :remote => true %>
Controller: def…
jalagrange
  • 2,291
  • 2
  • 19
  • 24
8
votes
1 answer

Rails 7: local (non-XHR) request with a form_with form

In Rails 7 a form generated with form_with tag sends remote request by default (turbo.js handles form submit event instead, whatever). Previously one would pass remote: false or local: true parameters to form helper, to get just a regular HTML form…
installero
  • 9,096
  • 3
  • 39
  • 43
8
votes
3 answers

rails simple_nested_form_for fields_for wrong number of arguments

So I'm building a form in rails 3.1, using <%= simple_nested_form_for(@person, :url => collection_url, :html=>{:multipart => true}) do |f| %> <%= render :partial => "form", :locals => { :f => f } %> <% end %> but this line in the partial is…
8
votes
2 answers

Attempt to send an email via Rails ActionMailer results in a failed call to `normalize_name` inside `lookup_context.rb`

I have a Mailer class which inherits from ApplicationMailer, which in turn inherits from ActionMailer::Base. Ruby version is ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin15]. The Mailer class looks like the following: class…
Richie Thomas
  • 3,073
  • 4
  • 32
  • 55
8
votes
2 answers

How can I get rails to not render escaped quotes as \"

In my layout I have <% @current_user.popups.each do |p| %> <% content_for :script do %> <%= "$(document).ready ( function() { $.jGrowl(\"#{p.message}\", { sticky: true }) });" %> <% end %> <% end %> And then in the script section I have <%=…
James
  • 5,273
  • 10
  • 51
  • 76
8
votes
5 answers

How can I stop the password field being pre-populated on edit?

I have this problem all the time in my rails apps and I still need the correct solution. Whenever a user edits their own record the password field is being populated. I suspect its Firefox as setting @user.password = nil in the edit action doesn't…
tsdbrown
  • 5,038
  • 3
  • 36
  • 40
7
votes
3 answers

Changing view on Menu Item in Action Bar

I'm attempting to implement a refresh button in my app to allow a user to manually re-sync to a web server. The code works, but I'm having trouble figuring out the action views (at least, I think that's what I'm supposed to be using). My menu item…
The Holo Dev
  • 1,016
  • 3
  • 12
  • 22
7
votes
7 answers

ActionView::MissingTemplate after Rails 3.1 upgrade

After upgrading to Rails 3.1.0 and following David Rice's instructions, all of my controllers strangely can't find their views anymore. # rails s # Started GET "/units" for 127.0.0.1 at 2011-09-04 07:52:23 -0400 Unit Load (0.1ms) SELECT…
7
votes
2 answers

Nested Object w/ Checkboxes - mass-assignment even with accepts_nested_attributes_for?

I thought that there should have been a simple solution to this, given that Rails 2.3 has this newfangled nested forms feature. Basically I want to create or update a user and assign them roles at the same time. It seems like I'm doing everything…
Bill
  • 1,563
  • 1
  • 15
  • 28
1 2
3
32 33