I''d like to modify the scaffold code that generates the ''_form.rhtml'' file. Where is the template for this? I''ve found the other templates, but don''t see this one. Would someone help me out. -Larry _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Larry Kelly wrote:> I''d like to modify the scaffold code that generates the ''_form.rhtml'' > file. Where is the template for this? I''ve found the other templates, > but don''t see this one. Would someone help me out. > > -Larry > >------------------------------------------------------------------------ > >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >It is in scaffold.rb def default_input_block Proc.new { |record, column| "<p><label for=\"#{record}_#{column.name}\">#{column.human_name}</label><br/>\n#{input(record, column.name)}</p>\n" } end I changed this in my scaffold to: def default_input_block Proc.new { |record, column| "<div class=\"fm-req\">\n<label for=\"#{record}_#{column.name}\">#{column.human_name}</label>#{input(record, column.name)}</div>" } end
Thanks for the pointer and the sample mod. I''ve search my harddrive and cannot find ''scaffold.rb''. -Larry def default_input_block Proc.new {|record, column| "<table class="form">\n for=\"#{}_#{}\"</table>"} On 7/1/05, Dominic Sisneros <dsisnero-Wuw85uim5zDR7s880joybQ@public.gmane.org> wrote:> > Larry Kelly wrote: > > > I''d like to modify the scaffold code that generates the ''_form.rhtml'' > > file. Where is the template for this? I''ve found the other templates, > > but don''t see this one. Would someone help me out. > > > > -Larry > > > >------------------------------------------------------------------------ > > > >_______________________________________________ > >Rails mailing list > >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > It is in scaffold.rb > > > def default_input_block > Proc.new { |record, column| "<p><label > for=\"#{record}_#{column.name <http://column.name>}\">#{column.human_name > }</label><br/>\n#{input(record, > column.name <http://column.name>)}</p>\n" } > end > > I changed this in my scaffold to: > > def default_input_block > Proc.new { |record, column| "<div class=\"fm-req\">\n<label > for=\"#{record}_#{column.name <http://column.name>}\">#{column.human_name > }</label>#{input(record, > column.name <http://column.name>)}</div>" } > end > > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Larry Kelly wrote:> Thanks for the pointer and the sample mod. I''ve search my harddrive and > cannot find ''scaffold.rb''.I think Dominic meant ''scaffold_generator.rb'', which is in <ruby_home>\lib\ruby\gems\1.8\gems\rails-<version>\lib\rails_generator\generators\components\scaffold\scaffold_generator.rb> > -Larry > > def default_input_block > Proc.new {|record, column| "<table class="form">\n > for=\"#{}_#{}\"</table>"} > > On 7/1/05, *Dominic Sisneros* <dsisnero-Wuw85uim5zDR7s880joybQ@public.gmane.org > <mailto:dsisnero-Wuw85uim5zDR7s880joybQ@public.gmane.org>> wrote: > > Larry Kelly wrote: > > > I''d like to modify the scaffold code that generates the > ''_form.rhtml'' > > file. Where is the template for this? I''ve found the other > templates, > > but don''t see this one. Would someone help me out. > > > > -Larry > > > >------------------------------------------------------------------------ > > > > >_______________________________________________ > >Rails mailing list > >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > It is in scaffold.rb > > > def default_input_block > Proc.new { |record, column| "<p><label > for=\"#{record}_#{ column.name > <http://column.name>}\">#{column.human_name}</label><br/>\n#{input(record, > column.name <http://column.name>)}</p>\n" } > end > > I changed this in my scaffold to: > > def default_input_block > Proc.new { |record, column| "<div class=\"fm-req\">\n<label > for=\"#{record}_#{column.name > <http://column.name>}\">#{column.human_name}</label>#{input(record, > column.name <http://column.name>)}</div>" } > end
Thanks, I found it that time. -Larry On 7/1/05, Justin Forder <justin-zSfPWr5aQuznITO/+xaoB7VCufUGDwFn@public.gmane.org> wrote:> > Larry Kelly wrote: > > Thanks for the pointer and the sample mod. I''ve search my harddrive and > > cannot find ''scaffold.rb''. > > I think Dominic meant ''scaffold_generator.rb'', which is in > > > <ruby_home>\lib\ruby\gems\1.8\gems\rails-<version>\lib\rails_generator\generators\components\scaffold\scaffold_generator.rb > > > > > -Larry > > > > > > On 7/1/05, *Dominic Sisneros* <dsisnero-Wuw85uim5zDR7s880joybQ@public.gmane.org > > <mailto:dsisnero-Wuw85uim5zDR7s880joybQ@public.gmane.org>> wrote: > > > > Larry Kelly wrote: > > > > > I''d like to modify the scaffold code that generates the > > ''_form.rhtml'' > > > file. Where is the template for this? I''ve found the other > > templates, > > > but don''t see this one. Would someone help me out. > > > > > > -Larry > > > > > > >------------------------------------------------------------------------ > > > > > > > >_______________________________________________ > > >Rails mailing list > > >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org <mailto:Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org> > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > It is in scaffold.rb > > > > > > def default_input_block > > Proc.new { |record, column| "<p><label > > for=\"#{record}_#{ column.name <http://column.name> > > <http://column.name>}\">#{column.human_name > }</label><br/>\n#{input(record, > > column.name <http://column.name> <http://column.name>)}</p>\n" } > > end > > > > I changed this in my scaffold to: > > > > def default_input_block > > Proc.new { |record, column| "<div class=\"fm-req\">\n<label > > for=\"#{record}_#{column.name <http://column.name> > > <http://column.name>}\">#{column.human_name}</label>#{input(record, > > column.name <http://column.name> <http://column.name>)}</div>" } > > end >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails