activeview

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 file name that is being rendered, so I need a reliable way to obtain this information. I...

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 their profile their public profile is unaffected until the administrator signs off their cha...

fields_for to stop pluralizing.

I have a fields_for tag, where I specify the prefix (lets say for some good reasons), and this is supposed to represent a one-to-one relationship. I am trying to represent a relationship widget has_many thingamagigs thingamagig has_one whatchamacallit The field_for code is: fields_for "widgt[thingamagigs_attributes][][whatchamacalli...

MultiView Control Selelct is Always null

hi my dear friends : I want to check multiview, ActiveViewIndex with Javascript, but in the below code, MultiView is always null: document.onkeyup = onkeyupOfDocument; function onkeyupOfDocument(evt) { var evt = evt || window.event; var MultiView = document.getElementById("MultiView1"); alert(MultiView); } How can i f...

MultiView And JavaScript (or jquery) Working...

hi my dear friends : how can i get multiview in javascript or jquery ? below code always returns null : (Javascript) var MultiView = document.getElementById("MultiView1"); and below code is not null but not work :(jquery) var MultiView = $("*[id$='TextBox1']"); what is the going on about that? can u give me plz a sample code fo...

Asp.net MultiView /check ActiveViewIndex With Javascript Or Jquery

hi my dear friends : why the below alert always shows me null? <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Keyup._Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" ...

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 share. Basically my purpose for doing this is so that I only have to have my navigation ...

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 myself code duplication, I would use a layout to render the general part, like this: # layo...