The actual error that I receive when run in 'console test' is a
'Duplicate key' error when trying to insert into one of the join
(HABTM) tables. I stress this error is not raised when run in 'console
development' so I know that my code is not trying to insert duplicate
rows in this table.
The und
it seems that <% %> is not exactly the same as in which,
PHP's
will add to the output
but
ERB's
<% puts "something" %>
will not?
Does someone know if JSP and ASP behave like ERB or PHP and can make a
summary of their likes and differences? Thank you.
--
Posted via http://www.ruby-foru
Rick Lloyd wrote:
> views/store/index.html.erb:
>
> <%= render(:partial => "layouts/test", :object => @array) %>
>
> views/layouts/_test.html.erb:
>
> <% for num in test %>
> <%= num %>
> <% end %>
Sorry, I don't know what that means, and I still can't solve my
original problem, which led t
One of my model code methods is throwing an error when run using
script/console in test but not in development.
I'd be grateful if someone can tell me the differences between the
two, beyond the database that they connect to.
Thanks.
--~--~-~--~~~---~--~~
You rece
views/store/index.html.erb:
<%= render(:partial => "layouts/test", :object => @array) %>
views/layouts/_test.html.erb:
<% for num in test %>
<%= num %>
<% end %>
On May 8, 5:59 pm, 7stud -- wrote:
> class StoreController < ApplicationController
> def index
> @array = [1, 2, 3]
> end
Hi
Thanks for the alternative approcah But I would like to know how can
I access a dll from rails?(Suppose from server side)
Sijo
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goog
I figured it out. I wasn't careful about where I was putting render().
I variously tried putting it in index.html.erb and in the layout
(layouts/store.html.erb). I ended up with render() in both files: one
specifying :object and one using :collection.
!...@#$!@#...@#$#!@@#...@#
--
Posted vi
class StoreController < ApplicationController
def index
@array = [1, 2, 3]
end
end
index.html.erb
-
render(:partial => "test", :object => @array)
_test.html.erb
<% for num in test %>
<%= num %>
<% end %>
When I enter the url:
http://localhost:3000/store
Im trying to create an api, and Im having trouble getting
ActionController to not run the raw post data through Hash#from_xml
(request.parse_formatted_request_parameters) for the XMLRPC post data.
I essentially want it to run through
XMLRPC::XMLParser::REXMLStreamParser.new.parseMethodCall(reques
I am not sure about your situation, but I would use observe_form set
and :frequency to seconds at which changes to this field will be
detected. This should work with the existing form.
See the documentation.
http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html
--~--~--
A caveat, It has to be done with the form already having been
created. So doing an observe form with a form id will not work as the
form id id being generated by rails as it is in edit mode.
On May 8, 9:38 pm, Me wrote:
> Would someone show how to implement a periodical save of a form in the
>
Would someone show how to implement a periodical save of a form in the
background? Same kinda thing that gmail does. I would like to
autosave a form ajax wise so a technician in the field would have it
saved off in case of a wireless disconnect while filling out a form.
thanks.
I would guess on
Are you using passenger's ruby? Seems I remember reading that if you
are you need to install gems via both the system-ruby and the
passenger-ruby as they end up in different spots and passenger-ruby
only looks for them in it's own directory heirarchy.
-p
On May 8, 2009, at 6:58 PM, Marc B
Platform - Ubuntu, 32-bit on EC2, jaunty jackalope
On line that says "require 'cloud_cache' " it says file not found.
Note that in order to get "require 'simple_record' " to load properly I had
to chown www-data:www-data on its files. I did the same on "cloud_cache"
files but no joy.
Again, all
On Fri, May 8, 2009 at 6:13 PM, Marc Byrd wrote:
> Anyone else having a dickens of a time getting Passenger+Apache2 to
> recognize the gem path?
>
> Many things that work well w/ webbrick just don't work at all with P+A -
> require fails.
>
> Here are my versions:
> gem 1.3.3 (from source, partly
Anyone else having a dickens of a time getting Passenger+Apache2 to
recognize the gem path?
Many things that work well w/ webbrick just don't work at all with P+A -
require fails.
Here are my versions:
gem 1.3.3 (from source, partly in attempt to get this working...)
Rails 2.3.2
Jaunty Jackalope
oops, I meant still NOT working**
Any ideas?
--~--~-~--~~~---~--~~
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 thi
The class will not work for a rjs call.. html class elements are not
unique by design so that is not a good idea anywho...
Here is a good description for div_for
http://apidock.com/rails/ActionView/Helpers/RecordTagHelper/div_for
It's just a way to create a div that has something todo with the
r
K I figured out how to fetch and send the AuthToken.. It's still now
working.
Anyone have any idea, or a resource for Flash file uploading to Rails
2.x?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails:
the code is here
http://pastie.org/472556
and here
http://pastie.org/472563
sorry about the extra bits
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk
Do you have to use an activeRecord object for div_for?
Perhaps I'm taking the wrong approach for "dynamic" divs
so far my education:
1. id= , is fine for just one div and prototype activity in an RJS (I
got this to work)
2. class= , another option, but I don't see how it can be used
3. div_for ,
2009/5/8 Marnen Laibow-Koser
>
> Colin Law wrote:
> [...]
> > I cannot check that they actually will be hidden when printing. Is
> > there
> > any way to do this?
>
> Several ideas come to mind.
>
> * Use JavaScript to check that display:hidden is properly set.
I cannot see how to integrate th
Colin Law wrote:
> In what sense do you want to access the dll, and are we talking here
> client
> side or server side?
I would hope the OP is interested in accessing a dll on the server-side.
I would hope that would not be possible to do client-side. That would be
mean there would have to be
Robert,
This makes more sense now. Thanks for the explanation!
If anyone is interested, I decided to do it this way (from Agile Web
Development with Rails book) :
map.resources :widgets, :collection => { :popular => :get, :heaviest=>
:get }
With this I can still add the custom method to my
Hmmm... I can use a Javascript solution and assume/hope the worlds'
browsers are all JS enabled. Or use a non-JS solution and assume/hope
the browsers/versions I don't test for will see things the same way.
Either way I don't see things degrading nicely.
My bias (rational or otherwise) is agai
Hmm. I think it may be something with the Authenticity Token. I think
I need to bypass it...
--~--~-~--~~~---~--~~
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 rubyonrail
> Hi All,
>
> Today, when I debug, I found that I don't understand a very basic
> function "super".
>
>
>
> class User < ActiveRecord::Base
> def self.columns
>puts "here."
>@ret = super
>return @ret
> end
>
> end
>
>
> This return only one line of "here
On May 7, 12:46 pm, zambezi wrote:
> In others words allow the user to undo a response and return the
> control to a null state (nothing selected).
Why not provide an "Clear" button that deselects all the radio buttons
in the group? That's simple Javascript, and I wouldn't call it a
"workaround"
Colin Law wrote:
[...]
> I cannot check that they actually will be hidden when printing. Is
> there
> any way to do this?
Several ideas come to mind.
* Use JavaScript to check that display:hidden is properly set.
* Generate a PDF file with the browser's Print command, then parse it
somehow.
*
On Fri, May 8, 2009 at 9:37 AM, zambezi wrote:
> Do you have any idea of what behavior to expect if I explicitly set
> each radio button's checked property to unchecked?
Again, it's up to the user-agent how it handles this situation. I'd just
suggest 1) either accepting having a visible "no pre
I am using an alternate style sheet for printing, loading it via
<%= stylesheet_link_tag 'print', :media => :print %>
which is working as expected.
The problem is with testing, I would like to test that the layout is working
correctly, in my controller functional tests, but I cannot see how to do
My bad MLK.
On May 8, 11:40 am, Osiris wrote:
> Way to be appreciative of someone trying to help you. Good luck with
> that.
>
> On May 7, 9:50 pm, Marnen Laibow-Koser
> s.net> wrote:
> > Todd Fox wrote:
> > > thanks Marnen and everyone, do you know of any examples or something i
> > > can hav
Way to be appreciative of someone trying to help you. Good luck with
that.
On May 7, 9:50 pm, Marnen Laibow-Koser wrote:
> Todd Fox wrote:
> > thanks Marnen and everyone, do you know of any examples or something i
> > can have a look at to get my head around it?
>
> What's to get your head arou
Hi Hassan,
Do you have any idea of what behavior to expect if I explicitly set
each radio button's checked property to unchecked? What will take
precedence according to W3C specs (or is this all just another browser
war casualty)?
<%= f.radio_button(:hypotonic_saline, nil, :checked =>
"unch
KARTHIKEYAN RANGASWAMY wrote:
> try for the spreadsheet-excel gem .you can google for spreadsheet-excel
> gem.You will get the sample code for it.if you dont get it just mail me
> i
> will provide you the sample code
Hi Karthik,
Can you guide me how to export data's to Excel sheet, which i am t
The question isn't really a performance issue, but rather one of
customization. If users are likely to need to add values to an
enumeration, (example: category for a blog post), then a lookup table
is a good idea. If the values are substantially unlikely to change
(see your examples - marriage sta
Anyone know what the answer might be? Or an up to date link that
explains?
--~--~-~--~~~---~--~~
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@googlegroup
I would also use a small join table with your sets ... so your users
can add properties on the fly.
On May 8, 9:13 am, Vipin wrote:
> On May 7, 8:09 pm, "Billee D." wrote:
>
>
>
> > Sometimes it''s a matter of taste or design constraint, but why not
> > use a small join table and a foreign key
Initially it was failing when running the code from within a Cucumber
step definition. In this step definition, I am implementing a Given
step (in part) by calling a method of a model. This method is throwing
the error. In summary, the step definition is as follows:
Given ... do
user = User.creat
Lee is using InnoDB.
Chris.
On 8 May, 15:02, Jodi Showers wrote:
> Lee -
>
> On 8-May-09, at 9:53 AM, Colin Law wrote:
>
> > Is it failing while running one of your tests (possibly an error in
> > the test) or while preparing for the test (possibly a problem with
> > your fixtures)?
>
> > C
Lee -
On 8-May-09, at 9:53 AM, Colin Law wrote:
> Is it failing while running one of your tests (possibly an error in
> the test) or while preparing for the test (possibly a problem with
> your fixtures)?
>
> Colin
to build on Colin's comment about your fixtures, if you're relying on
the
On Thu, May 7, 2009 at 7:03 PM, zambezi wrote:
> ... If I am going to use a three button
> group configuration, I need to have them all unchecked initially.
And as the W3C spec I quoted indicates, you *can't count on that*
if you're using HTML. Period. If none are explicitly checked by you,
th
Hi
I've been following this issue on Lighthouse (https://
rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/1977-
actioncontrollercachingsweeper-autoloading-is-broken). I've since
upgraded to 2-3-stable which contain's Josh's fix, but I'm still
seeing the same error:
`load_mi
Is it failing while running one of your tests (possibly an error in the
test) or while preparing for the test (possibly a problem with your
fixtures)?
Colin
2009/5/8 Lee
>
> I have some model code that runs fine in development environment but
> fails in the test environment.
>
> In test, the co
I have some model code that runs fine in development environment but
fails in the test environment.
In test, the code always fails at the same point with:
Mysql::Error: Duplicate entry '5-17' for key 'PRIMARY': INSERT INTO
`accessibilities_namespaces` (`accessibility_id`, `namespace_id`)
VALUES
In what sense do you want to access the dll, and are we talking here client
side or server side?
2009/5/8 Sijo Kg
>
> Hi
>Could anybody please suggest ways to access dll files from a rails
> application?
>
> Thanks in advance
> Sijo
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~-
Hi,
Thanks for the responses.
Sam, you mentioned that in your app, every user has his own pair of
keys and the private key is stored encrypted with the users password.
How many users does your system have? I was also considering trying
to set something like this up, but I believe it will be far
Hi,
I am developing a Rails app and now I want to try some Ajax
funcionality. I have a tracks list, and each track has a delete button.
I have this operation implemented without Ajax with a redirection, and
now I want to do it with Ajax. I am using JQuery and jRails.
Here is my code:
This is th
Tom Hoen wrote:
> 7stud -- wrote:
>
>> Is there a second redirect in your code somewhere?
>
> That is a good thought. I was thinking along the same lines, so checked
> the console after issuing a request that should end with a displayed
> flash message and saw that there was only a single redi
Hi All,
Today, when I debug, I found that I don't understand a very basic
function "super".
class User < ActiveRecord::Base
def self.columns
puts "here."
@ret = super
return @ret
end
end
This return only one line of "here.". It is very
f
Hi
Could anybody please suggest ways to access dll files from a rails
application?
Thanks in advance
Sijo
--
Posted via http://www.ruby-forum.com/.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails
hi,
use javascript and make new handle of kbd events. search google, I think
you'll find a lot of examples
t
Geekyra wrote:
> Hello all, r there any way to change the "return" key in form single
> line input ? For example, I want the form to submit the process using
> "ctrl-return" key instead
Hi,
Im using the count calculations in activerecord, see below
self.count(:id, :include => [:operating_systems], :group =>
'operating_systems.name, operating_systems.id',
This only returns 2 of the fields i need the id and the count:
count_id operating_systems_name_operating_systems_id
49
This might make more sense with a concrete example - see
http://github.com/asplake/path-to/blob/master/examples/delicious.rb
for metadata-driven API access to Delicious, brief writeup at
http://positiveincline.com/?p=254.
Mike
On May 7, 2:05 pm, "Mike Burrows (asplake)"
wrote:
> Hi all, please
ok ive rerun the app and recreated the error. Ive attached the entire
log development.log file and pasted it below. If whats meant to be there
isnt there then its rails fault and not mine. Ive used the development
log plenty of times to find sources of errors.
Im pretty sure it has something t
Hello all, r there any way to change the "return" key in form single
line input ? For example, I want the form to submit the process using
"ctrl-return" key instead of "return" key because I want to use
"return" key just to add another single line input, can it be done ?
thanx all
--~--~-~
I'm trying using STI to implement a hiearchy similar to this:
script/generate scaffold name:string type:string
class Person < ActiveRecord::Base; end
class Customer < Person; end
class Employee < Person; end
class Developer < Employee; end
I.e., there are two levels of inheritance (Developer <
Hi Tom,
I've moved the whitelistHelper tag to application_helper.rb, but it
still strips all the tags. :(
Thx, Pete
Tom Z Meinlschmidt wrote:
> hi,
> what about to put
>
> WhiteListHelper.tags += %w(a em p strong blockquote h2 ul li)
>
> into app/helpers/application_helper.rb ?
>
> inste
You could provide the third button hidden and initially checked. Show it
with javascript
when one of the other buttons is checked so that the user then has the
option of selecting it again. You could then make it disapear again when
selected if you wanted to.
Colin
2009/5/8 Andrew Vargo
>
> W
On May 7, 8:09 pm, "Billee D." wrote:
> Sometimes it''s a matter of taste or design constraint, but why not
> use a small join table and a foreign key? ENUM is also a great choice,
> as these guys have pointed out, but sometimes there is a bit of
> overhead -- but you shouldn't worry about that
On May 7, 6:24 pm, Colin Law wrote:
> 2009/5/7 Andrew Porter
>
>
>
> > Vipin wrote:
> > > in a database table if there is a field which has a certain set of
> > > fixed values. for example
> > > staus => {Single, Married, Divorced }
> > > OR
> > > state => {California, Albama, Olaska ...}
>
>
On May 7, 5:47 pm, Tom Z Meinlschmidt wrote:
> just realize...
>
> in the case od 1st method:
> everything is simple, but db grows.. but... you made some typo mistake
> (eg Albama instead of Alabama) and what then.. repair entire table to
> get the correct results? weird
>
> 2nd method:
> I'm u
in database only ...i am going to store both string /id in database
only
On May 7, 4:45 pm, Colin Law wrote:
> In the case of method 2 where would you store the tens of thousands of
> strings if not in the database?
> Colin
>
> 2009/5/7 Vipin
>
>
>
> > in a database table if there is a field wh
63 matches
Mail list logo