Displaying 20 results from an estimated 100 matches similar to: "Trying to make an app helper"
2005 Dec 19
3
Where to put code - app controller, or app helper?
I have a function i want to be used in both views and controllers:
def year_to_fiscal_year(year)
# converts, say, an integer 2003 into ''0304''
year.to_s[2,2] << (year+1).to_s[2,2]
end
Where should i put it ?
--
Posted via http://www.ruby-forum.com/.
2005 Dec 20
2
Designing a data-entry screen
Here''s what i''m trying to do:
Have 3 dropdowns up the top of a page, being: year, month, department,
and group. Also a button underneath that called refresh.
When you click refresh, it finds the 1 row of data from the database for
that year/month/dept/group and populates the fields into a set of
textboxes below.
Then you can edit what is in those textboxes, and click a
2006 Jan 17
9
Formatting a float with a set number of decimals
Another newbie question:
How do i convert a float to a string, rounded to a certain number of
decimals?
Thanks
--
Posted via http://www.ruby-forum.com/.
2006 Jul 26
7
Delete_all causes a deadlock on MSSQL database ???
Hi all,
When i use the ''delete_all'' function to remove a few rows from my
database, it causes a deadlock on the sql server. The delete seems to be
successful, it then redirects to the ''view'' page, and the record does
appear to be deleted as far as the ''view'' rails page shows.
BUT if i go into sql query analyser, i can''t do a
2006 Feb 20
2
Problem with flash[:notice] appearing twice
In my save function in my (ajax!!!) controller, i''ve got a bit like
this:
if ...
flash[:notice] = ''NOT SAVED: This month is locked''
render :partial => ''edit''
else
save it...
redirect to ''show'' action....
...
If i try to save an entry for a locked month, it correctly brings me
back to
my edit action with the
2006 Jan 17
2
How to run direct sql
How can i run and get the value from the following sql:
select avg(my_field) from my_table where which_year=''0506'' and
which_week <= 21 and my_foreign_key_id=10
cheers
--
Posted via http://www.ruby-forum.com/.
2006 Jan 24
4
How to filter an activerecord find_all...
I have a nice hierarchical table structure like this:
divisions
has_many groups
groups
belongs_to division
has_many subgroups
subgroups
belongs_to group
has_many units
units
belongs_to subgroup
I have a report which is based on units, but i want to be able to filter
the units by which subgroup, or which group, or which division. I also
want to sort them by division.name,then group.name,
2006 Mar 15
2
Using form_remote_tag, setting the form name
I''m using form_remote_tag like this:
<%= form_remote_tag \
:update => "div_id_dataentry_bottom_ajax",
:loading => "document.getElementById(''wait'').innerHTML=''Loading...'';",
:url => { :action => "dataentry_bottom_edit" } %>
And it makes this code:
<form
2005 Dec 21
3
How to make a drop-down automatically submit an AJAX form
Hi,
I know that to make a dropdown box automatically submit when you change
the value, you do this:
<select ..... onchange="this.form.submit();">
BUT i''ve got an ajax form, and if i do the above trick, it simply
reloads the ajax partial into the whole screen, rather than into the div
where it is meant to go.
I''ve already got it all working so that if you click
2005 Dec 22
2
Accessing an instance variable by its name (as a string)
Hi (again!)
I have a function which gets passed the name of an instance variable,
and spits its out all nicely formatted.
Just wondering, how do i access the variable, when all i have is its
name stored as a string?
So far i''ve got this code, but it looks horrible. Is there a better way?
eval("@" << inst_var_name << "." << field_name <<
2005 Dec 19
15
OpenSSL ''no ciphers'' error on OS X when using Net::HTTP
OpenSSL::SSL::SSLError: SSL_CTX_new:: library has no ciphers
This error is thrown whenever I use anything that uses Net::HTTP. OS X
Tiger, ruby 1.8.2 (2004-12-25) [powerpc-darwin8.2.1]
What could it mean?
Joshua Sierles
2005 Dec 19
10
missing shortcut
I''m trying to start RubyGems on my hd. Windows searches for and can''t
find a file named gemhelp.cmd
Can I download that files somewhere?
--
Posted via http://www.ruby-forum.com/.
2006 Feb 08
9
InPlaceEditor - IMG for OK / Cancel?
Hi all,
Is it possible to use images instead of plain text for the "OK" and "Cancel"
controls?
Thanks,
Best Regards,
EJC
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
2005 Dec 19
3
created_on, created_at defaulting to 2000/01/01 00:00:00
Hello all,
Rails 1.0.0
created_on is being set to 2000/01/01 00:00:00
Any ideas on this ?
Thanks!
Schema is
create table user_login_history (
id int identity(1,1) not null,
user_id int not null,
created_on datetime default(getdate()) not null,
created_at datetime default(getdate()) not null,
updated_on datetime default(getdate()) not null,
constraint pk_user_login_history primary key clustered
2006 Jan 27
5
Multiple Apps running under Lighttpd with scgi on a Windows Box ... possible?
I''ve run into a problem on one of my development machines. I''m trying to
run multiple rails apps on one dev machine that runs Windows. Problem is
that is seems that I can only run one scgi_service at a time, meaning
that only one of my apps will function at a time. Anyone know how I can
get around this, other than getting a *nix box (which I should have
soon, hopefully) ?
2005 Dec 20
3
Help needed: How to Launch web application on IIIrd party server
Hi All,
How to launch the web site on IIIrd party servers ?
Help needed.
Any help appreciated .
Regards
2006 Aug 14
0
Minor Release
Folks-
I just pushed new version of backgroundrb to rubyforge. THis release
fixes a bug with thread handling and also adds a few things.
Thanks to Chris Hulbert for coding up a win32 service and daemon
script. You will need to reinstall the plugin if you already have it
and delete the script/backgroundrb dir from your rails project. Then
run this command to see windows service usage:
2004 Sep 02
0
important tone up
ongemaklikdekion balantacguhj schlappner
If someone tells you our site o""ffers cheap FDA a""pproved med-icat,ions
with pre_scrip_tion, please don't just listen t_o them but t-o check our
site by yourself. The or-der that is sent t~o your door via fast and
reliable delivery service will prove.
eur.op_ean dr-u'gs & ne^xtday shipping
2005 Dec 27
3
Trouble combining :has_many, :finder_sql and :conditions to create a sub-search
I''m sure there''s something right under my nose that I''m missing. I
have two tables with two parallel one-to-many relationships. I wish to
use the :finder_sql parameter to essentially ''or'' the two foreign
keys.
What isn''t working for me is performing a ''sub-search''.
Let''s say the tables are "stores" and
2005 Jan 08
2
Help with Samba (net vampire) not pulling passwords into openLDAP backend - fails pam_ldap authentication - pam_unix used instead ?
Hi All,
Hope someone here can help me ?
*See end for background and system information...
I'm looking for advice or links to clear documentation on the use and
configuration of "net vampire" and it's ability to download PDC accounts
with passwords intact.
I have successfully used "net vampire" to synchronize my Samba BDC --
with my companies PDC. I've switched