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
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
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
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
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
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
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
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..
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
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
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/.
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
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
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
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
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/.
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
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:
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
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
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
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
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
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
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
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].
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
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
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
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
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 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/.
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]
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
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
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
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
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
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
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
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:
,[
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:
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
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
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
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
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
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
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
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
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/.
51 matches
Mail list logo