similar to: How do you use form helpers in your controllers or classes?

Displaying 20 results from an estimated 100000 matches similar to: "How do you use form helpers in your controllers or classes?"

2006 Mar 01
3
Form helpers and overloaded methods - help!
Can someone explain why form helpers appear to bypass any model methods I override for fields that are bound to database fields? It would be great if someone could tell me how to force the form field, etc to call the method instead of looking at the database / attributes collection. Let''s say I have a column called ''price'' in my database table "books"
2006 Apr 02
1
Looking for helpers/components/controllers for form wizards
Hi, In our project, we have a number of forms to be filled by the users. The forms are presented as wizards - each form as a number of steps. I would like to know whether there is an existing helper developed by the Rails community that can let me create wizards easily. We also want all wizards to have the same look and feel. Thanks, Yash -- Posted via http://www.ruby-forum.com/.
2006 Apr 23
5
Controllers in folders and helper scope in Rails >1.0
Hi, Here''s my problem. I tried to google it, read the release-docs and haven''t found anything similar. My application uses folders to store controllers, as described in the Rails book. I need to have same-named controllers for admin and for users, so it looks like this: /app/controllers/admin/project_controller.rb /app/controllers/admin/...
2006 May 23
1
Form Field Helpers... Do they need objects?
I''m trying to use the select helper but do not need to pass the values back to an object because this is just used as a param value. Everywhere I''ve looked I see that the form field helpers require an object name. I''ve tried omitting the name but I get an error telling me I have two few paramaters. (2 out of 3) Other than typing out the HTML myself (because the
2006 Aug 13
0
Inheritance in helpers? Or should I do it all in a completely diffrent way?
Hi there. In the process of learning Rails I''m displaying data from my model in an HTML table. The view template got really messy so I decided to build a class to tidy things up and help me with the table generation. I started out putting it in the controller. But then I thought that the right place for it (following the MVC pattern and Rails orthodoxy) would be in a view helper. But
2006 Aug 15
0
helpers and controllers?
hi people i have a function in the helper.... but i can''t use it in the controller. i don''t want to load of code the controller, a wanna use the helper, but don?t work it what happen any body knows the trouble? -- Posted via http://www.ruby-forum.com/.
2006 Feb 23
6
irb with rails
I was trying to access rails functions (number_with_precision) from an irb session. It can''t find the method. How do I load the libraries ? TIA LS -- Posted via http://www.ruby-forum.com/.
2007 Oct 10
2
RSpec seems to be having a hard time loading Helper classes
I am getting the error when I run the command: rake spec This is a new project with not current test written besides the ones auto-created for me. +++++++++ $ rake spec (in /Users/chrisolsen/Projects/Rails/chrisolsen/trunk) /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:266:in `load_missing_constant'': uninitialized constant ProjectsHelper
2007 May 21
0
Helpers not available to ActionMailer classes in backgroundrb
Hi there, I''ve got a problem I''m hoping someone else has run into before and might have some tips on. I have an ActionMailer class where I''m manually including my application helper along with simply_helpful for use in my html emal templates. This works fine when calling the mailer class from another model class.. (example.. @order.deliver_emails would be a method
2006 Apr 24
4
Does Rails need more useful form helpers?
I have been using rails professionally for only a month and a half now, but I am continually running into problems with form helpers and accessing multiple objects on a single page. To whit: 1. While text_field and text_area and such all support the :index option, the select helper does not. 2. When appending the text ''[]'' to a helper''s object name, the id is
2006 Aug 04
1
Need a better undersanding of form helpers
perhaps someone can take a little time to give me a better understanding of how to use form helpers. Here is what I''m working with in my app: user model - (the table where a user registers their information) it contains the following fields - first_name last_name email account_type (currently set to string but will probably be a select box with options) password_salt (I''m
2006 Aug 14
0
Automatic helpers for controller modules?
Just wondering, is there a way to automatically include helper modules for controllers in modules? Something like (which doesn''t work, so I use ''helper :items): app/controllers/admin/items_controller.rb app/helpers/admin/items_helper.rb Joe -- Posted via http://www.ruby-forum.com/.
2006 Feb 24
2
Formatting values of numbers using text_field
Anyone have a quick solution on how to format a number in a text_field tag? <% text_field "price", "amount" %> returns 100.0 and it would be nice if it showed 100.00 Of course, number_with_precision works nicely, but how do you make that work with text_field? I thought maybe overriding the getter in the model. However, this means I would have to bring the helper
2006 Jul 16
1
form helpers with non-ActiveRecord objects
I have an ActiveRecord model (called Festival) that contains an array of "FestDate" objects serialized into a sql text column of the Festival object. (like the Agile book first edition describes on p. 205) The FestDate objects themselvs are not ActiveRecord objects. (of course, otherwise they would be in their own table...) When working with a Festival, I would like to use various
2008 Dec 06
0
Problem in number_helper.rb ?
Hello, Today I noticed that the number_to_currency helper didn''t work anymore (it just returned the numeric value, without any currency). I tracked down the error and saw that editing line 89 ( number_to_currency method) as follows solved the problem : Old piece of code : begin format.gsub(/%n/, number_with_precision(number, :precision => precision, :delimiter =>
2006 Jun 01
0
overriding form helpers
Hi there, I''ve been trying to override the text_field helper with a version in my application helper. Whenever I try and call it from a partial I get the error: "uninitialized constant InstanceTag" I can override the text_field_tag no problem. But there''s lots of stuff I don''t understand in text_field. All I really want to do is set some common options for
2006 Feb 06
1
Two subdomains with diferent controllers but same helpers and components
Hi, I want to have www.myproduct.com and myclient1.myproduct.com working on same server. I would like to have different controller in wich subdomains, example: on www I want to have sgnup and prices controller and on myclient subdomain I want login, settings, etc... I can open two environments rails www rails clients or point the two subdomains to same environment rails myproduct Wich is
2006 Jul 20
2
using association properties in form helpers
sorry for the noob question: how do i reference an association''s properties in a form helper? e.g. if i wanted to build a select list to choose a user''s address''s state (user.address.state), how would i hook that to the "method" of collection_select collection_select :user, ???, States.find(:all)
2007 Jul 24
4
spec''ing helpers that use controller
Hi all, I''m in the process of creating rspecs for my helpers. One of the helpers in app/helpers/application_helper.rb looks like this: def page_name @page_name || "Define @page_name in #{controller.controller_name}::#{controller.action_name}" end The rspec is simply: it "should something" do page_name end
2007 Jul 14
2
Using Helpers inside a Controller
I want to use helpers inside a controller method for an AJAX application. After the page is loaded and displayed, there will be an asynchronous javascript request to load additional resources such as html forms and other data. The controller which handles the request will collect the resources and send them back in json format. def get_resources data=Hash.new data[:form1]=form_helper1()