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

How do I use rails ActionView::Helpers::NumberHelper in Sinatra?

I want to use the Rails ActionView::Helpers::NumberHelper module in my Sinatra views. Specifically, I'd like to use number_to_currency though I would love to have additional Rails helpers. If there is a more appropriate gem for Sinatra that…
Brice Stacey
  • 350
  • 2
  • 8
3
votes
3 answers

Rails js.erb not rendering partial file but get response file rendered

I have the following partial files _report.html.erb
REPORT

<%= link_to "Extract REPORT", "#", :class => 'btn btn-primary', id: 'load_panel' %>

<% rand = Time.now.to_i -…
Kingsley Simon
  • 2,090
  • 5
  • 38
  • 84
3
votes
3 answers

How to get Application Installation failed event in app

I have been using Action_View to install apk using following code Intent intent = new Intent(Intent.ACTION_INSTALL_PACKAGE); intent.setDataAndType(Uri.fromFile(new File(location + "myAPK.apk")), …
Rajeev Kumar
  • 4,901
  • 8
  • 48
  • 83
3
votes
2 answers

Getting RuntimeError: "In order to use #url_for, you must include routing helpers explicitly" when I've already included them

Inside a controller I've tried to run this code for when users that are already logged in stumble across the sign up page def index if current_user redirect_to homebase_url #should provide url to home for logged in users end end I've done…
boulder_ruby
  • 38,457
  • 9
  • 79
  • 100
3
votes
2 answers

ActionView: :Template: :Error Object not supported

I have been struggling to find an answer to this question, obviously I haven't done it yet. I tried coding my first little bit, I can open the server with no problem but as I open it, but insted of showing me what I coded, the server tells…
M. Vega
  • 53
  • 5
3
votes
1 answer

Rails variable loads first time and then is nil!

I am receiving the following error: ActionView::TemplateError (You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.include?) on line #24 of…
amaseuk
  • 2,147
  • 4
  • 24
  • 43
3
votes
4 answers

Reusing form_for in view for a mailer errors on forgery

I have a form_for in a template new.html.erb where I do the normal save to the DB and then an e-mail on success. I want the mailer to send the same new.html.erb as the body and pass the model so that the form is fully populated. I'm getting the…
jpfuentes2
  • 2,085
  • 1
  • 18
  • 19
3
votes
1 answer

Rails 4 content_for and yield displays blank page

I'm trying to render the following partial: <% content_for :admin_content do %>

Listing All Accounts

<%= paginate (@accounts) %> ...
<%= paginate…
B. Bulpett
  • 814
  • 12
  • 27
3
votes
3 answers

How does the yield magic work in ActionView?

I was looking at how content_for works and observed the block.call in the capture_erb_with_buffer method. It apparently magically writes to the buffer variable which is then pruned. However, this I believe is deprecated and you can just call…
Vagmi Mudumbai
  • 613
  • 8
  • 14
3
votes
2 answers

Android: how to open image from gallery?

I've created a method in my app that saves my layout as an image and presents it in the gallery. I'm trying to open it but I'm having a hard time with all the tutorials and different approaches... This is my code: SimpleDateFormat mTimeFormat = new…
EladB
  • 326
  • 5
  • 15
3
votes
4 answers

Class name to view path

I have a RoR application and model SomeModel. I have views for this model and I want to know - is there any method to get the view's path? Of course I can use for this model instance m = SomeModel.new v = m.class.class_name.pluralize.downcase It's…
Alexey Poimtsev
  • 2,845
  • 3
  • 35
  • 63
3
votes
3 answers

Trying to extend ActionView::Helpers::FormBuilder

I am trying to DRY up some code by moving some logic into the FormBuilder. After reading the documentation about how to select and alternative form builder the logical solution for me seemed to be something like this. In the view <% form_for @event,…
Felix Andersen
  • 1,381
  • 2
  • 14
  • 26
3
votes
0 answers

when I set a actionviewclass to an item on ActionBar, how can I set the width to the actionView

For example : If I want to use a SearchView on ActionBar, how can I set the width to the ActionView? I have tried setLayoutParams,it is not effective.The width I want to set is stubborn holding the constant width all the time.I don't know how can I…
3
votes
1 answer

rails 4.1 beta upgrade 'action-view no method error'

I am trying to upgrade my rails application from rails 4.0.2 to 4.1 beta, I followed all the instructions given on http://edgeguides.rubyonrails.org/4_1_release_notes.html#action-pack-removals . Whenever i run my application, this is the error i get…
Surendra Bobba
  • 476
  • 3
  • 17
3
votes
1 answer

Rails 3.2/4: Is there a way to easily render a template (partial, whatever...) from the console?

I've been looking for an easy way to render views (or templates). I've only seen complicated solutions all over the internet that involve getting the rendering engine, passing the context, which is normally an action view instance initialized with…
ChuckE
  • 5,610
  • 4
  • 31
  • 59