similar to: form_helpers ?

Displaying 20 results from an estimated 3000 matches similar to: "form_helpers ?"

2006 Jun 01
9
@model.errors.empty? => true; @model.valid? => false
Hi, So, how can the situation described in the subject come to be? In other words, what could be invalidating the model, yet not generating an error? thanks, jh ps. here''s the breakpoint session paste: irb(#<#<Class:0xb72eec00>:0xb72eeb10>):003:0> @project.errors.empty? => true irb(#<#<Class:0xb72eec00>:0xb72eeb10>):004:0> @project.valid? => false
2006 Feb 21
2
ActiveRecord before_ callbacks question
Hi! I need to set the primary key in a model and postgres table to something different than id. View Edit and such works in the scaffolded controller. However if I click in the controller below the list of data onto New then I get an error message like this: Showing app/views/admin/_form.rhtml where line #5 raised: undefined method `nr_before_type_cast'' for
2007 Jan 12
9
Nil object in E1 capture the order
I''m following the depot application in the rails bible Agile Web Development with Rails. In interation E1 NoMethodError in Admin#checkout Showing app/views/admin/checkout.rhtml where line #12 raised: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.include? Extracted source (around line #12):
2009 Dec 24
4
NoMethodError
Hi, In a few words, can someone explain to me the NoMethodError. Googling for answers will get you to something but a direct answer from experts will give you something. NoMethodError in Book#new Showing app/views/book/new.html.erb where line #4 raised: undefined method `title'' for #<Book id: nil, created_at: nil, updated_at: nil> Extracted source (around line #4): 1:
2009 Nov 18
4
rails newbie : routing error
After much ado about the naming of model adn controllers... model : Expense controller : Expenses route : map.resources :expenses Here I am using mysql database and created a unique index, since db:migrated created an id object and made it as primary key. Now in the def create @expense = Expense.new(params[:expense]) if @expense.save flash[:viola] = ''New expense saved.. be
2007 Nov 06
2
Why is this view spec failing?
I can''t figure out why I am getting a failure. It renders out fine in the browser. <h1>New member</h1> <%= error_messages_for :member %> <% form_for(:member, :url => members_path) do |f| %> <fieldset> <legend>Member Info</legend> <p><label for="member[first_name]">First Name:</label> <%=
2009 Feb 25
9
local variables in partials lead to NameError
I know I must be doing something dumb, but I can''t seem to send a local variable to my partial. The below code leads to the following error: NameError in Residential_listings#new undefined local variable or method `foo'' for #<ActionView::Base: 0x3fb53f8> I am trying to call the variable ''foo'' in a partial called _attachment.html.erb, which is nested in
2013 Mar 24
5
Rails 4.0 has_many_through and fields_for
Hi all, I am trying to reproduce rails 3.2 behaviour with fields_for and nested attributes. class ControllerAction < ActiveRecord::Base has_many :interactions, dependent: :destroy has_many :roles, through: :interactions scope :controllers, lambda {|name| where("controller_name_id = ?", name)} scope :actions, lambda {|name| where("action_name_id =
2008 Dec 20
3
undefined method `stories_path'
Hi, I recieve error "undefined method `stories_path'' for #<ActionView::Base:0x995b4ac>" when going to the view via site.com/stories/new The model is setup correctly, I can retrieve data from the db fine. I think it might be related to the helper but I have no idea where to start. It seems to think its failing on the first line of the view, i belive on the
2010 Jul 16
31
Added associations but don't see generated methods
Hi, I''ve got a Rails app working that includes two two classes, etc.: Expense & Vendor. I eventually learned that the mental concept I had of their relationship should be express in Rails as: class Expense < ActiveRecord::Base; belongs_to :vendor; end class Vendor < ActiveRecord::Base; has_many :expenses; end
2006 Apr 25
16
case statements in views...strange error on OSX
I have a simple case statement in one of my views. This works fine on my windows machine. Move to the mac and I get: "parse error, unexpected tIDENTIFIER, expecting kWHEN". I have not changed anything but cannot resolve the issue. my view has this in it (simplified for test) <% case controller.controller_name -%> <% when "accounts" -%> <h3>worked
2006 Aug 01
2
actionmailer cant find template in backgroundrb
Im trying to send mails from a backgroundrb worker and it seems like ActionView cant find my template. same code works as a rake task. here my worker: class StatusMailWorker < BackgrounDRb::Rails repeat 1.minutes # <-- hehe! def do_work(args) [...blah...] NotificationMailer.create_daily_report(users, rep, items) end end end its throwing the following error: No
2006 Apr 18
1
''wrong number of arguments'' for text_field?
This is probably something very simple but I can''t seem to figure out why I keep getting the ''wrong number of arguments (1 for 2)'' error with the following code when I try to create a new record. If anyone can see what is going wrong here please help! new.rhtml ------------------------------------------------- ... <%= start_form_tag :action =>
2006 Aug 04
8
Unable to follow basic RoR tutorial (Win32)
I have just set up RoR to find out for myself if this tool is stable enough to actually be used yet. Anyhow, I started by going to the RubyOnRails website and following the instructions to install the platform on my Windows 2000 PC. "Get Ruby on Rails in no time" "We recommend Ruby 1.8.4 for use with Rails." So... I downloaded 1.8.4 and installed: C:\>ruby -v ruby
2007 Dec 07
4
strange error on mock proxy
I''m banging my head over this really strange error in a view test when I run "rake spec". The weird thing is that I don''t get the error when I run the spec file by itself. Here is the spec (I know, fixtures are the devil): describe "/units/new.html.erb here" do fixtures :units, :accounts, :groups it_should_behave_like
2006 Jun 09
9
Opinions on catch-all routing?
I remember reading somewhere a tip on improving your search engine ranking, by forming URLs that included relevant text, e.g. www.domain.com/article/man_eats_hat. In the rails app that I''m writing, I''ve noticed I can set this up very easily by appending the post title (after downcase.split.join(''_'')) to the post link. So, blog.com/posts/4 can easily also be
2006 Apr 24
3
Storing images: filesystem or database?
For a while i''ve been storing image in my PHP apps in the filesystem, but with the potential for a Rails project coming up i thought it was time for a review :0) In everyone''s experience, is it best to store uploaded images in the db or just stick them on the filesystem with a reference in the db? I''ve seen various performance tests and security arguments for and
2006 Jul 14
20
Method for associated relationships
I have these tables set up like this: listings has_many :states <field>state_id [int] <other fields.... .............. .............> states belongs_to: listings <field>name <other fields.. ............... .................> In my view I have <%= listing.name %> have also tried listing.state_id.name , that didn''t seem to do the magic either. This
2006 Apr 26
4
Adding a column to a table
This is a real newbie question with what i''m sure will be a simple answer... If i add a column a table (in a development application), how do i update my models to reflect this change? Cheers, Steve
2008 Jan 25
1
form error with datetime select
Hi, Im trying to build a form using: <% facebook_form_for(:task, at task,:url => create_task_path) do |f| %> Assign Task To: <%= fb_friend_selector %> <%=f.text_field :ttype, :label=> "Title"%> <%=f.datetime_select :duedate, :label=> "Due Date"%> <%=f.buttons "Add" %> <% end %> But im getting an