[Rails] unobtrusive javascript - attaching a .js.erb page

2011-05-09 Thread Sergio Ruiz
i saw on one of the railscasts that using unobtrusive javascript, you attach your javascript to your page like so: if your view is: index.html.erb you could add a page named: index.js.erb and that javascript would be included on the load for that page. for some reason, it is not working for

[Rails] unobtrusive javascript - referencing instance varaiables

2011-05-09 Thread Sergio Ruiz
if i have a variable, such as: @text declared in my controller, how would i go about dereferencing that in an .js.erb file? i seem to see a lot of pages using: %= @text % to directly dereference the value, but i can't seem to get it to work.. i get invalid symbol errors (js errors) as soon as it

[Rails] storing raw html in as a string

2011-05-02 Thread Sergio Ruiz
if i had something like this.. ul class=list lione/li li class='two'two/li /ul how would i go about storing that in a string variable? i have tried something like string = END ul class=list lione/li li class='two'two/li /ul END but am having no luck.. thanks! -- Posted via

[Rails] models - 'find'-ing by a method

2011-04-28 Thread Sergio Ruiz
wondering if there is a way to do this.. say we have a model that has attributes length and width.. :length and :width and we have a class square: class Square ActiveRecord::Base def area area = length * width end end is there a way i can do a: Square.find(:area = '144') to

[Rails] Re: models - 'find'-ing by a method

2011-04-28 Thread Sergio Ruiz
thanks, guys! i ended up just writing a method for the model that does the check.. it's something that would only happen maybe once a week.. and then, maybe only one or two transactions. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the

[Rails] rspec - Could not find generator rspec_controller

2011-04-27 Thread Sergio Ruiz
for some reason, i cannot get the rspec generators to work. i am getting the following: $ rails generate rspec_controller Could not find generator rspec_controller. the rest of the parts of rspec (that i am familiar with) seem to be doing just fine. i am running: * rails (3.0.5) * rspec

[Rails] Re: rspec - Could not find generator rspec_controller

2011-04-27 Thread Sergio Ruiz
perfect! thanks! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to

[Rails] setting the size of a textarea

2010-08-02 Thread Sergio Ruiz
i have noticed this a few times in the past, but right now, i need to get this fixed so that my form will fit inside a div.. i currently have this code: %= text_area @project, :description, :rows = 2, :cols = 20 % which should give me a 20x2 text area... unfortunately, i get a huge text area..

[Rails] Re: setting the size of a textarea

2010-08-02 Thread Sergio Ruiz
Tim Shaffer wrote: It's possible you have a style that is overwriting the rows and cols attribute. you guys are correct! i am using blueprint CSS with this site.. unfortunately, this box is not bounded by a span-# div, so it makes some assumptions about the width of the textarea tag.. one of

[Rails] self referential model?

2009-10-26 Thread Sergio Ruiz
is it possible to have a model be belong to itself? say i have a category, and the category can be a subcategory of another category (or it might be a parent category).. is this possible, and does it make sense? something like: class Category ActiveRecord::Base has_many: categories end i

[Rails] Re: self referential model?

2009-10-26 Thread Sergio Ruiz
thanks, guys.. installed awesome_nested_set now.. playing with it.. looks cool.. i am guessing that there is no drop in method of using this with active_scaffold.. correct? anyway.. this looks great! thanks! -- Posted via http://www.ruby-forum.com/.

[Rails] accessing images in the /public directory..

2009-10-16 Thread Sergio Ruiz
i am taking a style that someone else put together, and have a simple question.. the page is currently buried in the site, along with its images.. i moved the images to /public/images the only problem i have is.. how do i access those files in this case... div id=headerTop

[Rails] Re: accessing images in the /public directory..

2009-10-16 Thread Sergio Ruiz
i got called in to put the guts into a design done by a college kid who 'knows computers'.. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To

[Rails] Re: accessing images in the /public directory..

2009-10-16 Thread Sergio Ruiz
got it! thanks for the help, guys.. yes, this file is FULL of problems.. i just need to get transferred over before i start fixing things.. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[Rails] problem sending email from restful authentication

2009-10-08 Thread Sergio Ruiz
i am having problems sending email using the restful authentication plugin.. the trick is, it seems there is a problem in getting openssl to work.. i am not sure where this falls into the scheme of things.. the error code i am getting is: OpenSSL::SSL::SSLError (hostname was not match with

[Rails] Re: problem sending email from restful authentication

2009-10-08 Thread Sergio Ruiz
hmm.. okay, i was initially used to setting up actionmailer (to use smtp) in environments, i think.. i have recently upgraded my rails.. i think it's in a new place.. it didn't put it in initializers either.. poking around.. thanks! -- Posted via http://www.ruby-forum.com/.

[Rails] Re: capistrano error.. can't use sudo

2009-08-27 Thread Sergio Ruiz
Robert Walker wrote: Sergio Ruiz wrote: set :user_sudo, false Should that not be?: set :use_sudo, false correct! thanks so much! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] capistrano error.. can't use sudo

2009-08-25 Thread Sergio Ruiz
i am having a problem getting capistrano to run my deployment.. it's trying to sudo run the spin script, and this client does not have sudo privileges.. i have added the following lines to my deployment.rb set :user_sudo, false set :runner, nil and i am still getting this: ** transaction:

[Rails] restful authentication - sending email activation

2009-06-04 Thread Sergio Ruiz
for some reason, when i run restful_authentication on my development server, the server will generate the activation email, but when i run the same codebase on the production server, the activation email makes no attempt to send.. [development.log] Processing UsersController#create (for

[Rails] observe_field - returning weird key/value pair

2009-05-15 Thread Sergio Ruiz
i am currently having a very strange problem with observe_field. i have a select box that looks like this: %= select product_section, section, ProductSection.find(:all, :order = title ASC).collect { |p| [p.title, p.id]}, { :include_blank = true } % i want to observe the drop down box to have

[Rails] Using adobe contribute on a rails project

2009-05-13 Thread Sergio Ruiz
we are currently trying to allow one of our clients to access and edit some html files on their site via adobe's contribute. the files live in the public directory of the rails site, and it seems like there is a problem with contribute connecting to the site. it looks like contribute is

[Rails] Re: Using adobe contribute on a rails project

2009-05-13 Thread Sergio Ruiz
unfortunately, none of the files are accessible by the browser.. since they all live outside the of the area served by apache.. the app is served via apache.. through a proxy.. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this

[Rails] Re: Using adobe contribute on a rails project

2009-05-13 Thread Sergio Ruiz
Colin Law wrote: The rails project public folder must be accessible, that is where all the js, css files etc live accessible as in correct permissions? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are

[Rails] Re: problems with scriptaculous..

2009-05-07 Thread Sergio Ruiz
hmm.. for some reason, neither of these work... this is really perplexing me.. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: problems with scriptaculous..

2009-05-07 Thread Sergio Ruiz
okay, i found it.. i am stupid.. there is a space in the div name.. div id=desc_entry_2 i removed the space, and it works fine.. i suck.. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are

[Rails] problems with scriptaculous..

2009-05-06 Thread Sergio Ruiz
for some reason, i am having the hardest time with the simplest possible use of a visual effect.. i have done this a million times, and this is first time i have had this much trouble. here's what i am trying to do: 1. set up a div with a link_to_remote that references its containing div [1].

[Rails] Re: file upload - save outside the rails project..

2009-04-17 Thread Sergio Ruiz
Jack Bauer wrote: In order for it to be saving where it's saving, RAILS_ROOT is probably being specified in there somewhere. Remove that and add the directory yourself to /home/user/public_html/upload or whatever it may be. i did just that.. i specified: ~/public_html/upload and what it

[Rails] Re: file upload - save outside the rails project..

2009-04-17 Thread Sergio Ruiz
Did you try expanding the path? File.expand_path(~/public_html/upload) perfect! this works great.. thanks! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on

[Rails] Re: file upload - save outside the rails project..

2009-04-17 Thread Sergio Ruiz
What about a softlink?? the only reason i shy away from a softlink is that i am using git/capistrano for development.. i would rather have my paths well defined.. thanks! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this

[Rails] Re: file upload - save outside the rails project..

2009-04-17 Thread Sergio Ruiz
Just remember that this may not work in Production. Brendon. thanks! i just checked.. here's how i have this set up.. the app runs as a user, inside that user's home directory.. the files are saved to that same user's ~/public_html directory.. via a subdomain: files.domain.com .. so

[Rails] file upload - save outside the rails project..

2009-04-16 Thread Sergio Ruiz
i currently have an app that uploads a file and saves it into the file system.. the one thing i cannot figure out how to do is save it outside the project.. for instance.. it currently uploads it to: ~/rails_project/public/upload i would like it to upload to: ~/public_html/upload any

[Rails] Re: trouble starting mongrel

2009-03-26 Thread Sergio Ruiz
rails should start. The fact that it works in development probably means you're running a different rails version there. thanks, fred.. removing now.. the weird part is that i am running 2.2.2 on both machines.. hmm.. thanks again! -- Posted via http://www.ruby-forum.com/.

[Rails] another problem starting mongrel

2009-03-26 Thread Sergio Ruiz
i am having yet another problem starting mongrel on my production server.. i am getting error [1] .. i thought it was that i needed to install a new gem, but nothing is ringing any bells.. any ideas? thanks! -- [1]

[Rails] trouble starting mongrel

2009-03-25 Thread Sergio Ruiz
i am having a weird problem starting mongrel on a current live server.. when i start it as script/console, i get[1].. when i start it from the command line, i am getting[2].. it runs fine on my development system.. i am not even sure where to look to hunt this one down.. anyone have any

[Rails] YAHosting inquiry (yet another hosting inquiry)

2009-03-25 Thread Sergio Ruiz
i have read some of the posts here, but it seems like they may be a little dated, so i am posting this to the forum.. i have a client who needs to have one smaller application hosted. initially, we set them up with a godaddy account, but there were just too many limitations to make that

[Rails] actionmailer - TypeError: can't dup NilClass

2009-03-09 Thread Sergio Ruiz
i am currently writing a mailer, and running into several problems that i have not run into before.. suddenly, rails is asking me for the following: ActionView::ActionViewError (Due to changes in ActionMailer, you need to provide the mailer_name along with the template name. i have changed my

[Rails] rails array.each returning array?

2009-02-27 Thread Sergio Ruiz
i am having a problem with a current piece of code, and it seems like the result for each on an array might be the culprit. according to everything i have seen before, this should work: a = [ a, b, c ] a.each {|x| print x, -- } should produce: a -- b -- c -- but i am getting: a

[Rails] Re: rails array.each returning array?

2009-02-27 Thread Sergio Ruiz
MaurĂ­cio Linhares wrote: What you want is map, not each (the ruby-doc is always your friend): ah! this ended up working perfectly.. thanks so much everyone... -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because

[Rails] streamlined - inset_table or membership in edit_view

2009-02-27 Thread Sergio Ruiz
for some reason, i cannot get this to work.. this is the very last piece of this entire project that is needed for completion, and it's totally stumping me.. what i have is a relationship in edit view that is showing up as a :select. i would like it to show up as an inset_table (i think.. i

[Rails] Re: geokit - using :through to connect models

2009-02-24 Thread Sergio Ruiz
thanks for your help! i am gonna have to look into this a little bit more to get my head around this.. thanks! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on

[Rails] geokit - using :through to connect models

2009-02-22 Thread Sergio Ruiz
hello.. i am currently trying to use :through to attach two of my models together using geokit. for some reason, i am running into a problem: ArgumentError: Unknown key(s): as i have two models, one that is geocoded, and one that belongs to that model. the models look like: ,[

[Rails] human readable controller_name

2009-02-20 Thread Sergio Ruiz
was wondering if it's possible to have a human readable controller name in my page title.. ie: if my controller name is: show_names i can have my view do: title The controller is: %= controller_name %/title and i can get: titleThe controller is: show_names/title but i would like to get:

[Rails] Re: human readable controller_name

2009-02-20 Thread Sergio Ruiz
these work great.. i can't figure out why i couldn't find them earlier... thanks! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to

[Rails] Re: another collection_select, HABTM, :multiple question

2009-02-13 Thread Sergio Ruiz
collection_select(:worker, :skillset_ids, ... holy mac! this worked spot on.. i read and reread the documentation a million times, and didn't get that.. thanks so much! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this

[Rails] another collection_select, HABTM, :multiple question

2009-02-12 Thread Sergio Ruiz
i am currently working on a project and having a really tough time getting a collection_select to work properly. this is using a multiple selection. this is part of a HABTM relationship, and it appears that i have everything set up correctly.. but there is just something not working ... the

[Rails] running an rjs function on page load

2009-01-30 Thread Sergio Ruiz
i am currently working on a function that adds markers to a map.. without getting into too much detail, the map is initially in a display:none div.. so, i had to do a few things to get it to show up correctly.. initially, i needed to add markers when the user clicked a link. i did this with a

[Rails] cli server restart..

2008-12-17 Thread Sergio Ruiz
at some point, things changed in the way the server works.. i am not sure where.. but i used to use mongrel_rails start|stop at the command line to restart the server.. it used to keep the pid in log/mongrel.pid now, when you run 'script/server start' it keeps the pid somewhere else.. i would

[Rails] What does the --git option do?

2008-12-10 Thread Sergio Ruiz
in starting a new project, i decided to try using the --git option to see what would happen.. i figured it might just make up a new project and put the whole thing under git control.. unfortunately, all i got was: fatal: Not a git repository everywhere.. can someone tell me exactly how this

[Rails] Re: removing row from a table using link_to_remote..

2008-11-06 Thread Sergio Ruiz
thanks everyone.. not sure what the problem was.. but i erased and retyped .. and it worked. i musta had a typo hidden away in there. thanks! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed

[Rails] removing row from a table using link_to_remote..

2008-11-05 Thread Sergio Ruiz
i have a table of values that are presented in a regular html table. what i would like to do is: when DELETE is selected in a row, use link_to_remote to do some processing on the selected record.. once this data is is processed, and the controller is done, i would like to delete that entry

[Rails] ERROR: RDoc documentation generator not installed!

2008-09-26 Thread Sergio Ruiz
i am installing rails on a new machine, and during each of my gem installs, i am getting this: 1 gem installed ERROR: While executing gem ... (Gem::DocumentError) ERROR: RDoc documentation generator not installed! anyone have any ideas? -- Posted via http://www.ruby-forum.com/.