similar to: Writing Specifications for Custom Form Builders (and Helpers)

Displaying 20 results from an estimated 500 matches similar to: "Writing Specifications for Custom Form Builders (and Helpers)"

2006 Feb 16
1
Help with validation
I am trying to write some simple code post a form, update the database and do some validation. I have 2 problems: 1) The validation fails but I can''t get hold of the error message 2) I can''t get the form to redisplay the previously entered data for the user to correct. I have 2 controllers: user and holiday. A user can request a new holiday by filling in a form. I have a
2014 Jun 12
4
[Bug 2245] New: Multiple USER_LOGIN messages when linux audit support is enabled on bad login
https://bugzilla.mindrot.org/show_bug.cgi?id=2245 Bug ID: 2245 Summary: Multiple USER_LOGIN messages when linux audit support is enabled on bad login Product: Portable OpenSSH Version: 6.6p1 Hardware: Other OS: Linux Status: NEW Severity: normal Priority: P5
2007 Aug 31
2
Give focus to an input field of a form
Hi, I am new to rails and I have setup Typo on my site. One little thing bugs me, the login page doesn''t give focus to the "user_login" field. I was wondering what do I need to do to make rails help with this? I have seen some simple inline javascript to set the focus, sort of like: document.<form_name>.user_login.focus() However the rails view doesn''t
2005 Dec 27
2
Rewriting FormBuilder
Hi, I want to extend formbuilder to make it output a lable (I know about labeled_form_helper made by technoweenie), my own formating, and a couple of extra tags inside the form attribute. I was easily able to extend form_remote_to. But when I continue to adjust the way elements are handled I don''t know how to continue. I can''t find the method text_field thats should is
2008 May 27
2
Help with Writing Meaningful Specs
Hello all, In yet another attempt to learn Ruby on Rails and Rspec I have started writing a simple life streaming app with will aggregate feeds from several places and save them in a database for later use. An internet search eventually led me to the following method for looping through the feeds in the database, getting the contents of the URL and then passing this into another model to prepare
2007 Jul 01
3
Session WTF ?
Hi. How to use session in ruby on rails ? I try to make it work for hours, but it still doesn''t work... In my controller I have this: def identification @current_user = User.new(params[:user]) ok = false redir = ''login_failed'' @remote_user = User.find(:all) @remote_user.each do |r_user| if (r_user.login == @current_user.login and
2008 Dec 07
0
boolean button helper
I don''t have a blog, but wanted to share this little bit of code with other semi-beginners like myself who are still learning to take advantage of rails features. Selecting an attribute with a boolean switch is a common pattern in forms. You can do it with a check box, but radio buttons are more expressive in some situations and better convey to the user that they are making a mandatory
2007 Aug 20
0
FormBuilder in rjs
I have a page, which renders a partial that contains a ''State'' drop down list. Upon change, it re-renders the ''City'' drop down, re- populating it based on selected state_id: Page: /customer/new.rhtml <% form_for :customer, :url => customers_path do |f| %> State: <%= f.collection_select :state_id, State.find(:all), ''id'',
2008 Dec 02
1
form_for with partial using do |@f|
Is it possible to pass this FormBuilder object to a controller and then back to a partial? I have a form rendering a partial that i would like to update with a call to my controller based on user selectable parameters, but when the AJAX comes back, i get this error message because i cannot pass a form builder object between the controller and the view: "undefined method
2006 Apr 23
3
custom form builder
In the API docs I found this: "You can also build forms using a customized FormBuilder class. Subclass FormBuilder and override or define some more helpers, then use your custom builder " I couldn''t find any further documentation on this. Where can I read more about this formbuilder class? For starters, where would I define a subclass of this class? TIA, Jeroen --
2006 May 10
3
AJAX reload
Ok I stole some script and I need some help on fixing it on one thing: Reloading on post. here''s the script: <div id="panel"> <form action="/loging_in/login" class="header-panel" href="/loging_in/login" id="login-panel" method="post" onsubmit="new Ajax.Request(''/loging_in/login'',
2006 Jul 11
0
Arbitrary elements in form_for?
I would like to use form_for in my project so that I can easily change the style of many forms at once. However, it seems to me like FormBuilders only support certain kinds of form elements(!). Surely there must be a way to add arbitrary labels/form elements to a form. Let''s say I had a form that looks like: ID: (plain-text label) Name: (text field) Birthdate: (date chooser) Picture:
2006 Dec 06
2
ssh 4.x using aix 5.3 auditing
Im trying to identify how ssh 4.5 interacts with the audit subsystem within AIX 5.3. i get an event when a user logs in, but not when they exit via ssh. i can get it to work with telnet, however. It would seem to me that if an event is captured from the login, that the same would be true for the logout. I've opened a PMR w/IBM, but not getting very much help. below is an example of my
2006 Jun 06
1
Redirect\Cookie bug with MSIE 5.5sp2
Hello all, There seems to be a bug in internet explorer 5 where a redirect causes the session to be lost. A controller says.... def login case @request.method when :post if @session[:user] = User.authenticate(@params [:user_login], @params[:user_password]) return redirect_to(:action=>''send_confirmation'') unless
2007 Apr 09
4
How do i switch off error wrapping for a specific field?
Hi, i have some issues with the default rails error wrapping. It wraps errors in a div with class ''fieldsWithError'', which is not good practice in my eyes. Adding a class ''error'' to the field would be much nicer. My solution to the problem: build your own FormBuilder. Funny enough, i found no (nice) possibility to switch error wrapping off while using the
2011 May 05
1
variables inside a template for my hp ilo device
I am writing a hp ilo module to automatically assign a static ip that is derived from the IP of the system which is fed in via facter. I basically just need to change the network the ilo is connected to. The ruby code works great inside the irb console. However, puppet doesn''t seem to be able to use the variable I have derived from the ipaddress. This is my first template so I am not
2009 Jan 27
2
Login form_tag with select_tag option
Hi all, In the application i develop, a sophisticated login system is required. Being a newbie in Ruby, i''m not comfortable with the select tag in the form tag. My requirement: 2 tables - User(LoginName, Password, RoleId...) and Role(RoleId, RoleName...) View - RoleNames to be loaded in the drop down box and On submit, RoleId to be passed to controller for authentication. My Code
2006 May 25
1
AppMailer and McCray''s theme generator
Hi, I am using Matt McCray''s theme generator. http://rubyforge.org/projects/theme-generator/ Everything works fine, but rendering an action in a controller using the AppMailer raises this: undefined method `current_theme'' for #<AppMailer:0x39df950> Is there someone who could help me ? Thanks ! Mickael. Traces:
2006 Dec 07
6
form_tag not producing output
I''ve got two servers, both with Rails 1.1.6 on them. I''m trying to remove some of the newly-deprecated stuff in my app, and I''ve run into a problem. My login page used to look like this: <div title="Account login" id="loginform" class="form"> <h1>Please Sign In</h1> <%= start_form_tag :action =>
2007 Sep 30
2
Outputing to the browser, how?
Hello, I''m writting some helper methods to write forms, so I have this working code: class TableFormBuilder < ActionView::Helpers::FormBuilder ["file_field", "password_field", "text_field"].each do |name| define_method(name) do |label, *args| @template.content_tag(:tr, @template.content_tag(:td, @template.content_tag(:label,