Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7641707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:59:34+00:00 2026-05-31T08:59:34+00:00

I have a partial = form.fields_for :cycles do |c| %tr{:style=>border-right:none;} %td{:width=>16%} = c.text_field :day,

  • 0

I have a partial

= form.fields_for :cycles do |c|
  %tr{:style=>"border-right:none;"}
%td{:width=>"16%"}
  = c.text_field :day, :size=>6
  = c.hidden_field :id
%td{:width=>"35%"}= c.text_field :hour, :size=>15
%td{:width=>"35%"}= c.text_field :hour_night, :size=>15
%td{:style => "width:7%;padding:0;border-right:none",:align=>"center"}
  = c.hidden_field :_destroy
  = link_to image_tag("panel_tools/delete.png",:size=>"15x15"), nil, :href =>"", :onclick => "check_nested_attr_destroy(this);return false;" 

I call this from the view like this

= form_for(@schedule_of_working, @new_action ? {:url => schedule_of_workings_path} : {:url => schedule_of_working_path, :method=> :put}) do |f| 
.....
= render(:partial=>'cycles', :collection => @schedule_of_working.cycles, :locals => {:form => f}) if @schedule_of_working.cycles.count > 0

I’m getting an error about undefined method form..

rails -v 3.1.0

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:59:35+00:00Added an answer on May 31, 2026 at 8:59 am

    Rails only really works well when you follow its conventions.

    You should avoid using: hidden fields, put with a form, passing in the action that way and I’m not sure what you are trying to do with the url in various parts, but anyway avoid these unless you have really good reason why you are not structuring it according to convention. Focus more on your routes and how resources are setup and your models and their relationships and your views should be very minimalist. In them I’m not sure what the hour and hour_night are, or theor length 15. Confusion mix of stuff.

    So your form, as is, has a few problems. Rather than specific advice I would just say re-write it. It should be much simpler than this. I would recommend watching some railscasts on forms, e.g.
    Forms Part one, two or three

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

if i have created a view model and have a partial form that is
I have a Form class partial class ProgressMainForm : Form { public ProgressMainForm() {
Currently, I have something like: public partial class Form1 : Form { delegate void
I have a text_area in a partial in a complex form that is called
I have a partial which generates a div with some form fields in it.
I have Recommendations that has_many Approvals. I have a form partial from scaffolded Recommendations.
I want to program something in both C# and F#. I have partial classes
I have a partial that I want to display in a layout only when
I have a partial view that I want to basically take care of itself
I have a partial view that is shared between two controllers and I'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.