Displaying 20 results from an estimated 20000 matches similar to: "Console and changes to models"
2006 Apr 17
7
Serve static XML files how?
Hi,
a Javascript in one of my Rails templates needs to load a static XML
file. I tried several places to put the actual XML file, and I also
tried to make the file a rails template (tried both .rhtml and .rxml)
and access it via a controller action. None of these ways worked. Does
the lighttpd server know how to serve XML files, or do I need to
configure it first? Or, is there a good workaround?
2006 Apr 07
3
How to consume XMLRPC/SOAP web services in Rails?
Hi,
does anybody know of any good HowTo for consuming XML-RPC and/or SOAP
web services in Rails?
I found some for Ruby (via soap4r/xmlrpc4r), but I was wondering whether
there is something built into Rails already. So far it looks like there
are methods to create web services, but not to consume them.
Ingo Weiss
2006 Apr 04
6
Console for Testing Routes?
Hi,
when the "Agile Web Development" book talks about routes, there are what
looks like console transcripts like the following:
URL> store
@params = {:controller => ''store'', :action = ''index''}
Is there something like a console for testing routes (where you could
put in a url and see how rails would route it)??
Ingo
--
Posted via
2006 May 24
3
using a helper from the console
I''ve got a couple of helper functions in my application_helper file that
I would like to run from the console (for debugging).
What is the correct way to invoke a helper from the console?
_Kevin
--
Posted with http://DevLists.com. Sign up and save your mailbox.
2006 May 22
15
collection_select default selected value
Hiall,
Unfortunately I just can''t find out how to setup a default selected
value when using collection_select. My call is like so:
<%= collection_select(:consultant, :lastname, @consultants, :id,
:lastname, { :selected => @current_consultant.id } ) %>
which is not working, I debugged so far that I know that
@current_consultant.id contains the correct value.
Any tips?
cheers
2006 Apr 04
4
Find records based on associated table''s colums
Hello,
Let''s say I have a model for a "house". Each house has_a "city", which
in turn has_a "state" which in turn has_a "country". The objective is to
retrieve all houses in a given state, say "Massachusetts".
Being new to Ruby on Rails what I like is that things that should be
simple usually are simple, and since we have easy access to
2006 Jun 16
1
diff (to html) for Rails?
Hi,
I am looking for a way to compare to pieces of text, and mark up the
differences with html. Basically the way Basecamp Writeboards do it. I
was wondering whether this is available as a plugin (my initial search
didn''t turn up anything).
Ingo Weiss
--
Posted via http://www.ruby-forum.com/.
2006 Apr 26
2
Problem with auto-submitting AJAX form
Hello,
I have a form generated with form_remote_tag that contains a selection
list. I would like to auto-submit the form when the user makes a choice
in the selection list, so I added an option :onchange =>
''this.form.submit()'' to select_tag
Now what happens is that when I make a choice, the partial template
get''s rendered as expected, but not replacing the
2006 May 26
5
scriptaculous - auto complete textbox with a drop down
Hi,
I''m using scriptaculous to provide an auto complete textbox - and it
works perfectly - but I was wondering if there was anyway to let users
navigate the choices using the keyboard i.e the curor keys as opposed to
having to use the mouse? Apart from that it''s perfect! :)
Cheers,
Pete
--
Posted via http://www.ruby-forum.com/.
2006 Apr 05
23
how to create RJS visual effects callbacks
I''m trying desperately to get visuall effects callbacks working in rjs
templates to no avail What I''m trying to do is fade an image, change
the div with the image to a new image, and then fade the new image back
in. How would I go about this in RJS Here''s a simple line from my rjs
that I can''t get to work. It is not using callbacks so the
2006 Apr 27
3
Where to put general utility functions?
Hi,
I have a bunch of utility functions. If I put them in
"controllers/application.rb" then they will be accessible from all
controllers. If I put them in "helpers/application_helper.rb" then they
will be accessible from all templates.
But what if I need to access them from everywhere - controllers, views,
even models? Where do I put them?
Ingo Weiss
--
Posted via
2006 Jun 21
7
acts_as_taggable and paginate?
Hi there,
I''ve been trying to paginate over a list of members that all share a tag in
common using the acts_as_taggable plugin. The regular way of paginating over
a collection doesn''t seem to work with acts_as_taggable. Here''s what my
method looks like that takes in a tag name, finds all the members that share
the tag and then displays all the members. Nothing too fancy
2006 Jul 15
12
Safe way to destroy records
Hello,
how can I check if a destroy was successful?
Is the object only frozen if deleted or do I have to do an additional
find to see if there is a record left?
What happens if an after_destroy callback returns false? Is there always
a rollback?
Markus
2006 Jun 04
5
Embedding link_to''s within text fetched from database.
Hi,
I have the following problem that I can''t seem to figure out. I want to
able to fetch some text from my database record in my controller, and then
add two links within the text and then send that back to the view to get
rendered so that the two links appear as links and when clicked on, they''d
basically call the corresponding action for the link. Would anybody know
how to
2006 May 04
1
Problem caching XML files
Hi,
When I turn on action cashing for actions that render as XML using
builder templates, the files are cashed with an .html extension, and
subsequently served as html which breaks things.
Is there a way to cache files with an .xml extension?
Ingo Weiss
--
Posted via http://www.ruby-forum.com/.
2006 Apr 20
2
previous|next navigation question
When creating "< previous|next >"-type navigation to browse through
records from a list of search results, what is the most efficient (best
practices-) way to determine what the previous and next records are for
a given record?
Should I store the search results array and the position (index) of the
current record in the session?
Or restore the results array each time (running
2006 Jul 20
3
sort_by with via a parent models child
I am having a problem with ruby''s sort_by function. I want to sort a
list of parent model objects based on the children of the parent models.
Normally you might say sortedList = modelList.sort_by { |model|
model[''someAttribute''] }
What I am tring to do is
sortedList = modelList.sort_by{ |model| model.children.find(:first,
order=>"price desc" ).price}
2006 May 04
12
RJSCallback 0.1
Announcing RJSCallback 0.1
The RJS Callback plugin is being developed to provide Ruby On Rails with
the ability to easily call RJS templates for the various callbacks
associated with AJAX function calls (e.g., :before, :loading, :complete).
Currently this plugin automatically detects, loads, and renders RJS
templates with specific names and inserts them in the appropriate spot
in
2006 Mar 09
4
Testing Migrations
Is there some standard way to test migrations?
It seems to me that an additional safeguard for migrations would be to
test and see if applying the migrations to the test database allows one
to reconstruct the structure of the development database.
If you can''t, then there is an error in your migrations, most likely
because someone hand-modified the database without generating a
2006 Jul 14
5
Ideas for AJAX pagination
Hi,
I am looking for ideas on how to remove the last item from a
paginated page when a new item is inserted, thus leaving only 10
elements on the page.
Currently I have a form that inserts with AJAX, but as expected, each
post added to the page just increases the number of posts leaving 11
on a page that should only be displaying 10.
I have unique ID''s for each post (e.g.