Questions tagged [activeview]

32 questions
13
votes
2 answers

Rails: Content_for in partial

I have something like this in my layout ... <%= yield :test %> ... <%= render :partial => 'user/bar' %> And in user/bar.html.erb I have <% content_for :test do %> stuff <% end %> And this doesn't seem to work. And I have found out that yield :test…
Ximik
  • 2,435
  • 3
  • 27
  • 53
2
votes
0 answers

Ruby on Rails form with array of nested hashes

I'm trying to build a rails form to submit an array of nested hashes. In controller i want to get params in structure like: [ { id: 'section1', rows: [ { id: '1', seats: '1-20' }, { id: '2', seats: '1-25' } ] …
Oviron
  • 161
  • 1
  • 7
2
votes
2 answers

Pass instance or local variable from layout to view in Rails

I'm trying to set up a rather complex form using form_for. This form needs to be in multiple views, where some fields would be available across all actions and other fields are specific to each individual actions. I thought that in order to save…
vonconrad
  • 25,227
  • 7
  • 68
  • 69
2
votes
2 answers

Current view file in Rails helper method

Is there some way to determine what file currently is being rendered by Rails (2.2) in a helper method. An example result would be "/sessions/new.html.erb" or something similar. I am trying to write a helper function that does something based on the…
wvanbergen
  • 2,294
  • 15
  • 15
2
votes
2 answers

Create a "main layout" view in Rails?

Ok so I have a small project with two different scaffoldings I've made.In the layouts directory therefor there is two different layout.html.erb files. My question is how to condense this into just one main layout file that the two scaffolded views…
Earlz
  • 62,085
  • 98
  • 303
  • 499
2
votes
2 answers

Create simple class inside erb template

I'm displaying duplicate blocks of content in an erb (email template) and I thought I would make a simple class that would represent each block. I tried something like this which works if I manually render the erb, but if I try to send the email I…
benathon
  • 7,455
  • 2
  • 41
  • 70
1
vote
0 answers

Google ad activeview does not count correctly. Shows browser size is 0( bs: 0,0)

I have google ad in web site.Ad is visible to client. But in google statistics viewability is 18-20%. I inspected in browser.It shows browser size:0,0 px(bs:0,0). sig: Cg0ArKJSzK9xkPVRs7FEEAE id: lidar2 mcvt: 1003 p: 225,425,315,1153 mtos:…
1
vote
2 answers

Bootstrap login button not the color I'm expecting

In my app/views/users/sessions/new.html.slim, I have: .container = form_for(resource, as: resource_name, url: session_path(resource_name), html: {class: "form-signin"}) do |f| h2.form-signin-heading =…
EastsideDev
  • 6,257
  • 9
  • 59
  • 116
1
vote
1 answer

Rails Display Bootstrap Alerts Using Helpers

I am trying to follow this Gist to display Bootstrap alerts for a crud rails app https://gist.github.com/suryart/7418454. The contents of which have the code: application_helper.rb: module ApplicationHelper def bootstrap_class_for flash_type {…
adamscott
  • 823
  • 1
  • 10
  • 31
1
vote
2 answers

Asp.net MultiView /check ActiveViewIndex With Javascript Or jQuery

Why does the below alert always show me null? <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Keyup._Default" %>
SilverLight
  • 19,668
  • 65
  • 192
  • 300
1
vote
1 answer

How to use nested_form_fields with grouped records?

By default nested_form_fields gem renders all existing records of the specified association jsut under the <% = f.nested_fields_for %> tag. The question is how to combine nested_form_fields with model grouping by name ( MyModel.all.group_by(&:name)…
lessless
  • 866
  • 10
  • 27
1
vote
2 answers

Catching exceptions in a render call from a rails helper

This is for a rails 4.0.2 application running ruby 2.0.0-p353. I have a helper that has the following method def render_feed_row(activity_item) begin if activity_item.type == "comment" render "newsfeed/comment", :item => activity_item …
Cyrus
  • 3,687
  • 5
  • 35
  • 67
1
vote
1 answer

rails 3 form_tag method: :get to include only the fields that were changed

I'm writing a search form that will reload the page adding to the URL the search parameters. Currently the URL generated by my form contains all the form fields, including the empty ones. This clutters a lot the url generated with data that is…
Don Giulio
  • 2,946
  • 3
  • 43
  • 82
1
vote
1 answer

How to stop Hotmail Active View from previewing video links in HTML Newsletters

I have created a custom HTML newsletter for a client and it is working correctly in all clients. In Hotmail, the video link from the newsletter is being previewed at the top of the page by active view. The youtube link:
nfrost21
  • 559
  • 2
  • 10
  • 27
1
vote
2 answers

Managing child relationships with a nested attribute form

What I'm trying to do is the following: At anyone time a user can have 1 active profile. This active profile must be authorized by an administrator to make sure that it is compliant with the rules and regulations of the site. When a user edits…
jonnii
  • 28,019
  • 8
  • 80
  • 108
1
2 3