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
4
votes
1 answer

Cannot solve "ArgumentError: Missing block" when calling form_for in Rails namespaced Controller

In the admin panel of an app, there should be a new form introduced. I wanted to make use of 2.3 Relying on Record Identification as described in RoR Guide, but if I say form_for(@product) or form_for [:backend, @product] it throws an…
Yo Ludke
  • 2,149
  • 2
  • 23
  • 38
4
votes
5 answers

Open file picker form my Android activity

I'm making an Android app which stores some downloaded pdf files inside the device's SD card. Everything works fine, but now I want to add a function to just pop up the default android file/folder browser showing the directory where my app stores…
Carlo Moretti
  • 2,213
  • 2
  • 27
  • 41
3
votes
1 answer

Rails: ActionView::Template::Error (Operation not permitted Error in production.log

Here is what keeps popping up in my production.log Started GET "/" for 173.26.190.110 at 2011-12-08 12:21:24 -0500 Processing by PagesController#home as HTML Rendered pages/home.html.erb within layouts/application (19.9ms) Compiled application.js …
Noah Clark
  • 8,101
  • 14
  • 74
  • 116
3
votes
1 answer

Android : URI for open an image with ACTION View

This is the code protected static final String DIR_IMAGE = "/data/data/it.android.myprogram/images/"; Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); Uri u =…
Mimmo
  • 157
  • 2
  • 12
3
votes
0 answers

How to rotate the android action view

I am making android program. I tried to show pdf in web view. So, I created a new action view (...) and loaded a pdf file in my view. And I also have a description of "android:configChanges="orientation|keyboard"" in the manifest XML.But, if i…
smiler
  • 315
  • 1
  • 3
  • 8
3
votes
0 answers

How to display images stored in the Cache Folder using ACTION_VIEW

I'm creating an app that downloads a lot of pictures from a website and stores them all in the cache folder so that it won't take up too much space on the phone. Now my problem is that I want the user to be able to click on an image and it will…
3
votes
1 answer

ArgumentError: Wrong Number of Arguments Errors when upgrading Rails 6.1.3

I recently upgraded a Rails 6.0.3.5 app to 6.1.3 after the mimemagic fiasco. Now, I see this interesting issue that is happening after the view is rendered, which is strange. How do I debug this? The app is using Ruby 2.7.1 Here is the full stack…
arjun
  • 191
  • 1
  • 8
3
votes
1 answer

What is the reasoning for having form_with not generate any ids?

The form_with helper doesn't generate ids for form elements, and therefore doesn't generate for attributes either. This differs from the old form_tag and form_for helpers. If you want to use form_with instead of the deprecated form_tag and form_for…
David Gay
  • 1,094
  • 2
  • 16
  • 32
3
votes
1 answer

How to get original exception from ActionView::Template::Error

If a template causes an ActiveRecord::RecordNotFound exception to be raised, the original exception is swallowed up by ActionView and turned into an ActionView::Template::Error. It seems that in Rails 5 there was an original_exception method but…
Alex Dunae
  • 1,290
  • 3
  • 17
  • 28
3
votes
1 answer

Rails Render Action With Different Format

Say I have an application#search method that I would like to respond to AJAX requests. Inside of my JS view (app/views/application/search.js.erb) I would like to render the HTML view: $("#content").html( escape_javascript( render( :action =>…
lyricat
  • 1,988
  • 2
  • 12
  • 20
3
votes
1 answer

Rails yield and content_for wieird behaviour, `yield :filter` only work if placed after default yield

Lets say i have this partial i am trying to render #layouts/_subheader.html.erb
<%= yield %> <%= yield :filters %>
when i use this partial in a view like this <%= render 'layouts/sub_header' do %>

3
votes
3 answers

Rails: Passing local variables from Controller to View

I was trying to pass a local variable from controller to a view: # pages_controller.rb def my_method render template: "pages/new_page", message: @message end # new_page.html.erb <% if message %> Do something <% else %> Do something else <%…
3
votes
2 answers

how to correctly extend form_for / ActionView::Helpers::FormBuilder?

This is similiar to Trying to extend ActionView::Helpers::FormBuilder but I don't want to use :builder => MyThing. I want to extend form builder to add custom methods. This is the current situation: module ActsAsTreeHelpers def…
pdu
  • 10,295
  • 4
  • 58
  • 95
3
votes
1 answer

Rails - How would I get the URL of a single image asset in the controller?

I've tried including ActionView::Helpers::AssetTagHelper and then using the image_path() method however it gives me grief: undefined local variable or method `config' for ActionView::Helpers::AssetTagHelper:Module There's probably something simple…
digitalWestie
  • 2,647
  • 6
  • 28
  • 45
3
votes
3 answers

Latest Rails 3: ActionView::Template::Error (couldn't parse YAML at line 105 column 13)

I have recently encountered into a weird problem or Rails 3, possibly ever since the new rubygems 1.5 update. Basically when I deploy my program to nginx with passenger 3.0.2, I have 500 page immediately and problems like this in my production…
wlicpsc
  • 389
  • 1
  • 6
  • 13