Displaying 20 results from an estimated 2000 matches similar to: "Sharing controller code between views - best practices?"
2011 Aug 19
2
Multiple Traveling Salesperson Problem
While R has library TSP to help solve traveling salesperson problems, does
anyone know if it has any libraries to help solve multiple traveling
salesperson problems? For instance, suppose one is planning school bus
routes and one has multiple buses. Thank you for your time.
--
View this message in context:
2006 Jan 04
7
recongizing the current controller in views
alright i am doing a simple self blog in ruby. Now iw ant to be able to
determine which controller action i am in inside _form.rhtml.
So if i am in new or the creation control than i want to insert the text box
for topics else i want to display the topic base on id. (i could do those
already, i just need help finding the right if statement..
something like (if currentpage ==
2006 Apr 07
5
[OT] Centrex Question
I haven't dealt with Centrex for a long time, and one of my customers is
being courted heavily by a Sprint salesperson.
Am I not correct in assuming that each "line" of Centrex corresponds to
an "extension" in the PBX world?
This site has 2 POTS lines and 5 extensions, and they told me that for
the same thing they're paying right now (~$40/POTS line) they will be
2006 Jan 17
2
Building from scratch, would like the benefit of everyone's experience
Hi all,
I am going to be building an Asterisk system to replace the current
aging (aged) Nortel Meridian system in a travel agency. There is
already a voice T-1 in place and currently there are about 20 extensions
in use. I would want to move up to about 25 extensions immediately and
about 30-35 within the year.
I am going to want IVR and voicemail, plus the ability to ring a group
of
2005 Mar 09
10
Confused about extending the login generator ''user''
I''ve been using the login generator ''out of the box'' for simple
authentication, and its been working fine.
Now I want to extend it by simply adding ''type_id'' field which links to
my ''user_types'' table, but I''m hitting:
#<ActionController::SessionRestoreError: Session contained objects where
the class definition
2013 Jun 18
1
How to Pass Jquery selected dropdown values and radio button values to controller
Hi,
I have an advance search page and its code is as follows -
I have written my code like this
<div class="container">
<%= form_tag search_index_path, method: :get do %>
<%= radio_button_tag ''user_type'', ''customer'' %><p>Customer</p>
<%= radio_button_tag ''user_type'',
2008 Apr 09
3
form_tag and form_for cause #protect_from_forgery errors
Hey All,
I''m trying to do a simple form_for (and I also get it with form_tag)
and I''m getting the following error:
ActionView::TemplateError (No :secret given to the
#protect_from_forgery call. Set that or use a session store capable
of generating its own keys (Cookie Session Store).) on line #2 of
users/new.fbml.erb:
1: <h1>Welcome To Courses, Let''s Get
2009 May 14
3
Mysql query is not working
Please,
Can anyone help me to execute this query?
SELECT * FROM table WHERE customer_id IN (SELECT IF(1 <> 2,''SELECT
customer_id FROM customers'',''SELECT customer_id FROM company''))
Regards...
--
Posted via http://www.ruby-forum.com/.
2006 Mar 22
1
How do you clean up this cryptic code?
So, I''m coding my school project in Rails.
There are two models, User and Restaurants.
I noticed that in Restaurants, when you use the belongs_to method, you
could specify the condition of the associated table. There are a few
types of users, in the user_type column of the users table - owners is
type 1, users are type 2.
So in my haste to hand in enough code, in the Restaurant model,
2005 Sep 15
2
Caller ID for auto outgoing calls
Hi. I'm using /var/spool/asterisk/outgoing files to place automatic
calls, but I'm having trouble setting the Caller ID for the second half
of the call.
In other words, when we call the first number, we want the Caller ID
set to our number, but then when we connect them to the second number,
we want _their_ number to be the Caller ID.
I've tried the following (and various
2006 Apr 19
2
Beginner problem with foreign keys
Hi, I''ve been trying to get this to work all night. I''ve made some
progress by reading other posts, but I''m stuck now and can''t figure out
what I am doing wrong.
I have two tables: application_users and user_types. In my
application_users table I have a field named "user_type_id". At first,
I thought if I set up the foreign key with the correct
2006 Feb 23
5
Q: Where to put a periodic updater?
Hello,
I need to put a script in place for updating a local database with a
remote resource periodically. It should be started alongside the
server (or inside it, whatever) and be run as long as the server
running my rails app is up an running.
Any thoughts on how to accomplish this?
I have thought of editing the environment.rb file and placing the call
to the script trigger there, but I wonder
2006 Mar 23
7
Fixtures just Do Not Work for Me
Hello,
I have been struggling to get fixtures to work here with no success.
They just Do Not Work For Me (tm).
I have created a model named Headline with the `generate'' script and
modified the test/fixtumes/headlines.yml as follows
----------
gita:
id: 1
author: raulseixas
title: gita
happened_at: 2005-01-01 00:00:00
description: gita
This is the CD reissue of
2008 Apr 03
1
Anyone experienced RSpec/Autotest forgetting models?
Hi
Saving a controller spec frequently gives me this error:
52)
LoadError in ''UsersController GET /users with basic request params should
find all the user types''
Expected /home/amoran/Documents/becta/apps/Backend/app/models/user_type.rb
to define UserType
./spec/controllers/users_controller_spec.rb:299:
script/spec:4:
I have to Ctrl-C autotest before it will load again.
2006 Mar 14
6
Framework
hello all,
I need any framework that generate models using the database
structure....
Anyone knows if have this framework????
Thank''s
--
Posted via http://www.ruby-forum.com/.
2006 Jan 29
3
Models within Modules
I have models within a module file and access them from my controller
with Module::Model syntax, but only get unitialized const errors. I even
tried require ''mymodule'', etc, no avail. The Prg
Google has ZERO help on this, and I can''t believe more people haven''t
run into this issue. What''s the deal?
Frustrated,
John
--
Posted via
2008 Jun 18
1
Ruby on Rails 2.1 Unit Testing
Hi,
Just introduced few more chapters in my Ruby on Rails 2.1 tutorial. Most
interesting one is Unit Testing of RoR Applications.
Just go through it and send me your comments.
http://www.tutorialspoint.com/ruby-on-rails-2.1/rails-unit-testing.htm
Thanks.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2006 Feb 23
5
Web/HTTP Testing
Hello,
I am looking for a user test automation tool. When I say ''user'', I
mean it should mimic the user interacting with the app. That
ultimately boils down to a tool that drives a browser or is able to
make http requests and allow us to deal easily with the responses.
Our requirements are to be able to write the tests in Ruby (no need to
switch to other language for test
2006 Mar 06
4
rails internals?
Is there a list for discussing Rails internals or is that kind of one
of those jealously guarded secret things?
Also, I seem to be being a bit of a prat today, but if you read this closely:
http://www.rubyonrails.org/images/headlines/community.gif
Bit of a grammatical error there. (Sorry!)
Giles
2005 Dec 21
4
[offtopic] Asterisk <-IP-> Siemens HiPath 4000
Hello!
Is it possible to connect Siemens HiPath 4000 to Asterisk? What
equipment required on Siemens side? I mean IP not E1.
Sorry for asking here. Siemens-related websites use "salesperson
language". There is no technical information.