Displaying 20 results from an estimated 40000 matches similar to: "working with Blocks"
2006 Mar 19
2
Functional Testing
Hey all,
I have a many-to-many relationship (Questions
has_and_belongs_to_many Answers), and when I destroy
the Question (the one) I also destroy all the Answers
(the many).
Since the following doesn''t seem to work for
has_and_belongs_to_many:
class Question < AR::Base...
has_and_belongs_to_many :answers, :dependent =>
:destroy
end
I have this embedded in a transaction block
2007 Apr 10
5
newbie :: Convert integer to string in Ruby
Hi all,
Please anybody tell me how to Convert integer to string in Ruby and
concat it.
Suppose I''ve a string "ABC" , I want to concat it with a number say
"ABC12" .
Please help me out.
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post
2006 Sep 11
2
Compilation Errors
Hey there,
I just updated to ferret 10.0.4, and acts_as_ferret 0.3, and now when I
try to run my app with mongrel on Windows, I get very strange compile
errors:
ompile error
C:/rails/app/script/../config/../app/views/login/index.rhtml:8: Invalid
char `\002'' in expression
C:/rails/app/script/../config/../app/views/login/index.rhtml:9: syntax
error
_erbout.concat "
2006 Feb 07
3
Newbie help ..
Hi ..
I am new to Rails and it is not clear to me why I am getting the
following error. Any help appreciated.
-m.
$cat app/views/admin/new.rhtml
<% @page_title = "New member..." -%>
<%= start_form_tag( :action => ''create'' ) %>
<table>
<tr>
<td> First Name: </td>
<td> <%= text_field(
2006 Mar 09
4
sort-weirdness - active record issue?
I''m selecting data into a controller and sorting it. The code (in the
controller) looks like this:
def index
@assignments = []
tasks = Task.find(:all, :conditions => ["person_id = ? and
actual_end_date is null", session[:user].id.to_s ])
issues = Issue.find(:all, :conditions => ["person_id = ? and status
<>
2006 Jan 19
9
start_form_tag not taking url_for options
I''ve got a form that should post to user/login. The code to start the tag is:
<%= start_form_tag { :controller => "user", :action => "login" } %>
That gives me this exception:
compile error
script/../config/../app/views/user/login.rhtml:1: parse error,
unexpected tASSOC, expecting ''}''
_erbout = ''''; _erbout.concat((
2007 Feb 12
1
Invalid char problem
Has the problem with corrupted .rhtmls (invalid characters) been solved
so far?
I would like to use ferret and acts_as_ferret on Windows XP. I have
installed 0.10.9 (mswin32) which still seems to have the problem.
I am receiving error messages like:
compile error
C:/INSTAN~1.4P1/INSTAN~1/rails_apps/travelogue/config/../app/views/article_editor/_header_read.rhtml:2:
parse error, unexpected
2010 Jun 18
2
[PATCH] hdt & gcc -Werror
From: Gene Cumm <gene.cumm at gmail.com>
Fix several calls to more_printf() as eventually printf() is called
without a literal string which generate warnings with gcc and lead to
errors when -Werror is active.
Signed-off-by: Gene Cumm <gene.cumm at gmail.com>
The message "format not a string literal and no format arguments" at
first seems strange but by doing this change
2007 Nov 10
3
Wrapper Helper Help Please
Hi all. I''m hoping this is a simple one that someone can put me right
on.
I have a view that ''wraps'' some div''s around a Page Header and Page
Content, for formatting reasons:
<div id="LHS">
<div class="Page">
<div class="PageHeader">
''Header Here''
</div>
<div
2007 Jul 25
5
editing multiple models in one form
Very new to this but would appreciate a hand as this is driving me mad,
I''m trying to update both degree and assigned from a single form, the
degree section updates fine but assigned just retains the same values,
any help much appreciated!
my edit.rhtml file looks like:
<h1>Editing degree</h1>
<%= error_messages_for :degree %>
<%= start_form_tag :action =>
2006 Mar 11
4
Live search in Rails
Hi i''ve been trying to implement live search on rails but Im having
trouble Im using a tutorial at:
http://www.joestelmach.com/blog/live_search_with_ruby_on_rails
But im getting a syntaxerror on line 1
''1: <% if @items && @items.length > 0% >''
I cant fathom what im doing wrong, is that line calling a column in
my database called items?
2006 Jun 17
4
Textmate Madness
Has anyone come across this problem... I created some Ruby files in Textmate
on my Mac - and everything works fine. However, when I run those files on a
Windows machine I get e.g.
compile error
./script/../config/../app/views/station/consumption/new.rhtml:2:
Invalid char `\002'' in expression
./script/../config/../app/views/station/consumption/new.rhtml:4: parse
error, unexpected
2007 May 28
2
helper with block compile error
HI,
i''m trying to write a helper that replaces link_to_remote that
accepts a block but it gets a compile error in the template:
I don''t know what I''m doing wrong... TIA
# application_helper.rb
def link_block_to_remote( options = {}, html_options = {}, &block)
concat(link_to_remote(capture(&block), options, html_options),
block.binding)
end
# in
2010 Nov 28
6
has_one accepts_nested_attributes_for fields_for NOT WORKING HELP
MODEL
class User < ActiveRecord::Base
has_one :address, :dependent => :destroy
accepts_nested_attributes_for :address
end
CONTROL
def new
@user = User.new
@user.build_address # Adicionei
...
VIEW partial _form
....
<% f.fields_for :address do |b| %> # Adicionei
<%= b.text_field :city_manual %> # Adicionei
<% end %>
2008 Dec 13
2
Need Help in converting php encryption decryption code to ruby on rails
Hi guys i found this encryption decryption in php and try to convert
it in rails but i am unable to successfully convert it. So plz help
me. I you write the whole conversion code then it will be great.
PHP code is like this
================
#
#/**********************************************
#**
#** MD5 block cypher
#**
#** Author..: leapinglangoor [
2008 Apr 06
10
about the form_for ..
question one:
is there any select box tag for form_for?
now,perhaps i just can use the select or select_tag?
question tow:
i have a A model,it has one B such as:
class A< ActiveRecord::Base
belongs_to :B
when i use the form_for tag,how can i output the variable name?like
this:
<%form_for :a,@a,:url=>{:controller=>"a",:action=>"save"} do |f|%>
2009 Jul 07
10
link_to, how do you combine url options and html_options?
I have a link-to that I wish to look somewhat like this:
link_to "link here", new_object_path,
:method => :post, :confirm => ''Press OK'', #url
options
:class => "css_class", :id => "css_id" #html
options
In any case I can either get the url_for options to work or the html
options to work, but
2006 Mar 01
15
Is there a perl equivalent of .= in ruby/rails??
I want to make a for loop that concats strings onto a variable:
html .= var1 + "this is a test" + whatever
What is the syntax that does this in ruby/rails?
Also, is there a ''print'' method in ruby? Because when I try to use
render_text it will only let me use this once.
--
Posted via http://www.ruby-forum.com/.
2010 Sep 03
2
Problema con parámetros en collection_select (No novato)
Hola a tod@s,
Les cuento... Tengo lo siguiente en aplicación:
Una página donde esta mi modelo docencia que a su vez le voy agregando
todos los dictados de carreras:
<fieldset>
<% f.fields_for :dictados do |dictado_form| %>
<%= render :partial => ''dictado'', :locals => { :f => dictado_form }
%>
<% end %>
<%= add_child_link
2011 Jul 25
4
[Rails 3.0.9] I have trouble about fields_for
Hi,all. I''m new bee to Rails and I have trouble about fields_for
method..
It isn''t show up between the <%= f.fields ~ <% end %>
Please teach me some advice.
Thanks!
#new/_form.html.erb
<%= form_for(@user) do |f| %>
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<!-- Below