similar to: Formatting in form helpers

Displaying 20 results from an estimated 9000 matches similar to: "Formatting in form helpers"

2006 Aug 19
5
Form helpers don''t work with facade columns?
Hello all, I''ve been trying to use a facade column but I notice that the form helpers don''t seem to respect the facade. In the following example I''m trying to story the prices as Integer values but present them to the user as decimals. class Product < ActiveRecord::Base def price=(new_price) write_attribute(:price, Float(new_price)*100) end def price
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
2010 Jul 19
1
instance_exec routes -> form helpers
The new router in Rails 3 is clean and concise and marks the acceptance of instance_exec as a method for writing a gorgeous DSL. I''m wondering should something similar be applied to the default form helpers? Moving from this: <%= form_for(@post) do |f| %> <%= f.text_field :title %> <% end %> to this: <%= form_for(@post) do %> <%= text_field :title %>
2006 Nov 28
2
(no subject)
I''m using wx_sugar 0.1.2 with wxruby2-preview 0.0.37 on OSX and am coming up with a strange error when trying to create a SpinCtrl: class DatePicker < Wx::Dialog def initialize super(nil, :title => "Pick a date...") arrange_vertically(:padding => 5) @month = Wx::SpinCtrl.new(self) # line 19 add(@month) end end gives error:
2007 Dec 09
0
Writing Specifications for Custom Form Builders (and Helpers)
Hello all, Long time reader, first time poster! I am a relative newcomer (no idea what on earth I am doing) to Ruby, Rails and Rspec and have a feeling I am probably trying to run before I know how to walk. I had imagined a cool way of outputting a div around some form stuff which would have a class on it if the related field had errors, something a bit like: <%
2006 May 15
0
Using rails form helpers for non model objects
Here''s a very simple tutorial that I wrote for using form helpers like text_field or text_field_with_auto_complete for creating non model attribute fields. http://eugene.eggkeg.com/?p=8 -- Posted via http://www.ruby-forum.com/.
2012 Feb 17
0
HtmlSlicer 0.0.1
How to split HTML content? Well, the text like: <p>Ruby&nbsp;on&nbsp;Rails is a next-generation web-framework<br><b>YEAH!</b>And of course Java killer?! :) &copy;</p> You can split to a pages in a smart way. I tried to realize it in a gem for my internal use, and now when it works for my Rails 3.1.3 application, this is enough to make it public. I
2006 Jan 03
6
Am I going too far or Rails is just confusing? was {validates_presence_of *_id attributes}
Thanks for the input Blair Zajac and Chris (Nolan and Hall), and for others. If all of you have time, please follow this (the question still relates to the previous posts by me): I have provided full steps to reproduce the symptoms. If it matters, I''m running Ruby 1.8.2, Rails 1.0, and MySQL 5.0.15 on Windows XP Professional. 1. First, the setup MySQL ----- create database testdb;
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
2007 Feb 28
1
Rails 1.2 Bug (?): to_text_area_tag
Hi all, I''m fairly new to rails and thus might be missing something here, but I think I have found a but in ActionPack. If this is not the right place to post this, please let me know where. I discovered this issue while attempting to use the lastest edge version of ajax_scaffold (mooey, MUI, whatever it''s going to be called). I kept getting the error: private method
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 Nov 29
5
wxSugar control problem
I''m using wx_sugar 0.1.2 with wxruby2-preview 0.0.37 on OSX and am coming up with an error when trying to create a SpinCtrl (and quite a few others have exactly the same prob.): #file date_picker.rb class DatePicker < Wx::Dialog def initialize super(nil, :title => "Pick a date...") @cal = Wx::CalendarCtrl.new(self) add(@cal) #works fine up to
2008 Oct 20
1
LC_VIRTUAL with Wx::ListCtrl
Wx::ListCtrl#set_item_count appears to be broken. If I pass it anything but a Fixnum (is_a Integer), it crashes and says it needs a "long" (which Fixnum should appease), but if I pass it a Fixnum it crashes with "cannot convert nil into String." Latest WxRuby. Windows Vista. This makes using LC_VIRTUAL impossible. -- Eric Will // xmpp:rakaur@malkier.net
2006 Aug 16
4
Overwrite form helper methods and call old ones in new ones?
Hi all All my forms should look the same, so I think always putting the right div etc. tags around them is a violation of the DRY principle. Until now my forms look like that: <div class="text_field"> <label for="news_item_subject">Subject:</label> <%= text_field "news_item", "subject" %> </div> Now I want the default
2006 Jul 02
1
multitable form
Hi all, Although I''m experienced with programming I''m a beginner with ruby, RoR and MVC So I follow examples from books and so on and all is ok. I can make a model who is a class and who match to a table in my database and then I generate pretty forms on a webpage. I would like to know how I can do to make forms who interact with more than one table. For an example lets
2008 Oct 08
2
private method `gsub' called for 2:Fixnum
RoR Error: “private method `gsub'' called for 2:Fixnum” I am new to RoR and trying to complete “RailsSpace Social Networking” example, all works fine until I have implemented cookies using authorization_token, and start getting following error when trying to login. “private method `gsub'' called for 2:Fixnum” I can make out that there is something related to String conversion
2008 Jan 25
2
form formatting
If I want to use fbml elements and rails tags, is there a way to do within a fb:editor? if I do: <% facebook_form_for(:task, at task,:url => create_task_path) do |f| %> Assign Task To: <%= fb_friend_selector %> <%=f.text_field :ttype, :label=> "Title"%> <%=text_field_tag :newrnumdays, ndays, :label => "# Days"%>
2006 Jul 20
1
Override coulmn data type - urgent
Hi- I have a BigInt (MySql) column type - RAILS treats it as FixNum, which causes big problem for us since we need to store a 12+ number of digits. How can I tell Rails to treat is as BigNum instead of FixNum? thanks thila -- Posted via http://www.ruby-forum.com/.
2006 Mar 04
13
Using helpers from controllers ?
There is a solution to use helpers from controllers ? I have an error : |undefined method `content_tag''| class ApplicationController < ActionController::Base def test return content_tag("a","test") end end
2009 Feb 02
4
AssociationTypeMismatch got Fixnum
I''m using rails 2.0.5 and mongrel. I have a Page and a Source models. class Source < ActiveRecord::Base has_many :pages end class Page < ActiveRecord::Base belongs_to :source end Basically I''m listing pages with their sources; In production and development ( I use mongrel_cluster in the first and a single mongrel on the second) I got this error: