Displaying 20 results from an estimated 1000 matches similar to: "Reuse code"
2006 Mar 28
5
RJS call from controller issues javascript that doesn''t get evaluated by browser
Hi,
I''m on Rails 1.1 and I have a problem wit RJS
In my cotroller i have
==>>>
def show
@contact = Contact.find(params[:id])
render :update do |page|
page[:contactInfo].replace_html :partial=>"contactInfo"
end
end
<<<===
And my contactInfo partial looks like this and it''s placed inside a div element
==>>>
<table>
2006 Mar 14
7
Starting with RJS - not working
Hi,
I''m trying to work with RJS and folowed Cody Fauser''s tutorial
(http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates)
I''ve started by creating a new rails applications and executing
rake freeze_edge
rake rails:update:javascripts
rake rails:update:scripts
After that I''ve created a controller:
class DtestController < ApplicationController
2006 Jul 03
6
Rjs $("aaa").insertHtml is not a function error
Hi,
I''ve searched the list and found that someone had the same problem as me
http://lists.rubyonrails.org/pipermail/rails/2006-May/043760.html
I''m have in my page a link like this
<%= link_to_remote ("Add
#{image_tag(''add.png'')}",:url=>{:action=>''addProduct''})%>
and in my controller
def addProduct
..................
2006 May 16
5
Transactions in RoR
Hi,
Does anyone knows how to manage transactions in RoR.
Thanx
2006 Apr 07
1
Validate_presence_of error in nested object is not displayed
Hi,
I have a contact object . This contact has a address object
>>Contact
class Contact < ActiveRecord::Base
has_one :address
validates_presence_of :first_name ,:last_name
end
.>>> Address
class Address < ActiveRecord::Base
belongs_to :contact
validates_presence_of :address
end
Addres has the following fields ; address, phone, fax, email
In the contacts_controller I
2006 May 16
1
Nice Ruby tutorial for begginers
http://tryruby.hobix.com/
2008 Jan 11
9
Varying test data
This isn''t specific to RSpec, but is hopefully on-topic for this list.
I like (especially when "ping pong pairing") to write a spec, then
write the smallest amount of code I can to pass it (especially when
"ping pong pairing"). Sometimes this means hard-coding a return value,
which means another spec is needed to prove that the code is really
behaving as it
2012 Nov 21
2
Moving file after transfer
Hi,
I\m writing a VFS module that needs to move a file, after it is transferred, to a folder that is not shared.
The shared folders that use this VFS module are used to sent files for processing by another application. The module signals the application that it has work to do and moves the file.
So far I've been using the last close call, moving the file after doing SMB_VFS_NEXT_CLOSE().
2011 Sep 21
5
problem with submit button in rails 3
hi,
i am using <%= s.submit ''Product save'' %>
when i click it, following error appears
" Routing Error
uninitialized constant ProductsController"
could any one provide me solution ?
thanks,
-pab
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send
2015 Feb 10
2
Dovecot 2.2.15 issues with global ACL
Hello,
We have upgraded from Dovecot 2.2.13 to 2.2.15 and we are using global ACL file.
The content of the ACL file is as following:
* owner r
INBOX owner lrwstipekxa
INBOX/* owner lrwstipekxa
user owner rwstipekxa
user/* owner rwstipekxa
This worked fine but after update any user cannot see any folders from under the INBOX, also they cannot create any new folders.
Error into the logs are
2007 Dec 29
15
Do you think it would look cleaner?
I was looking over some of my specs.
I was thinking that the following:
@game.should_receive(:name).and_return(''The Battle for Blaze'')
@game.should_receive(:people).and_return(5000000)
@game.should_receive(:activated).and_return(true)
Would it look cleaner if I could do this instead?
@game.should_recieve_and_return(
:name => ''The Battle for Blaze''
2007 Oct 23
6
Problem Upgrading from 1.0.5 to 1.0.8
Hey Guys,
I''m getting the following error:
1)
NameError in ''ProductsController with a GET to /products NO NAME
(Because of Error raised in matcher)''
uninitialized constant Spec::Mocks::BaseExpectation::AnyArgsConstraint
/Users/mattlins/Projects/RailsProjects/SWNetworkServices/vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/render_observer.rb:86:in
2008 Jan 08
47
specs on private methods
How does a person test private methods?
Is there a way to declare them as private, but retain any tests that
were written during the initial development?
Thanks.
--
Posted via http://www.ruby-forum.com/.
2006 Apr 21
9
Capistrano, OS X
If you installed your copy of ruby via DarwinPorts, the hashbang lines
at the top of your dispatch.* scripts says "#!/opt/local/bin/ruby". This
is a problem, if you''re deployin via Capistrano to a host with a
different path to ruby (which would be practially all of them:-)
Here''s a fix. Add this "fix_hashbangs.rb" script to your script
directory.
2006 Jul 07
2
Get controller''s module path
Hi,
Given a controller such as Maintenance::ProductsController, is there a
way to obtain the module section ''Maintenance'' within a view.
I am planning to highlight the maintenance option from a common menu
whenever a controller from the Maintenance module is used.
Thanks, Andrew.
--
Posted via http://www.ruby-forum.com/.
2005 Aug 18
1
Auto Complete, works as adverrtised?
I''m trying to use the auto complete now and I get:
undefined method `auto_complete_for'' for #<ProductsController:0x40a44338>
My code is:
def auto
auto_complete_for :product, :title
end
Just like in the "view source" div from the demo. Well, almost like it. Am I
missing .rb library somewhere?
thanks
Jacob
2009 Jun 26
1
rSpec Newbie Question - Testing controller
Hi
I am very new to rspec and would like to learn more. I have googled
around and asked in irc with no firm answers.
I have the following controller :
class ProductsController < ApplicationController
before_filter :loadsidebar
def show
@category = Category.find(params[:id])
@products = @category.products
end
private
def loadsidebar
2005 Dec 28
3
Module loading
I''ve looked high and low for the answer to this and can''t seem to find
anything that helps.
I have an admin section (much like Typo) where all controllers are based
on the Admin::BaseController.
My directory structure is
[RAILS]
-app
--controllers
---admin
----base_controller.rb
----products_controller.rb
Products controller is:
class Admin::ProductsController <
2007 Dec 22
8
Rails 2.0 scaffold
Hey guys,
I posted the other day about scaffold not working and i was told that it
was rails 2.0 doing this. (btw i''m using adgile web development)
I have read on the internet that you need to put extra stuff like title,
description......
So i did this:
C:\ruby\depot>ruby script\generate scaffold Product Admin id:int
title:varchar(1
00) description:text image_url:varchar(200)
2008 May 04
5
simple Routing Error
Routing Error
No route matches "/user/register" with {:method=>:get}
The URL is http://localhost:3000/user/register
Here is app/views/user/register.rhtml
<h2>Register</h2>
<% form_for :user do |form| %>
<fieldset>
<legend>Enter Your Details</legend>
<div class="form_row">
<label