Displaying 20 results from an estimated 70000 matches similar to: "How do i manually abort a transaction?"
2006 Jul 31
2
Wizard-like multi-page transaction
Hello
Is it possible to create something like wizard with database
transactions, so transaction would begin on page one, then on page two,
three... etc. there would be some data altered in the database and then
on the last page the transaction would be committed or rolled back?
thx
Zvonko
--
Posted via http://www.ruby-forum.com/.
2006 Apr 26
3
catch all error for incorrect urls etc
Hi,
I am changing a very standard old school website to rails. When I make
the change to rails, all of the old urls will not be valid. If a
person has a bookmark to an old web page I would like them to be
directed to the front page of the new website www.domain.com. How do I
do this? Do I do something in routes.rb?
Thanks,
Peter
2006 Aug 04
5
A couple of ferret 0.9.4 exceptions
Hi Dave,
I am using ferret at my site http://gifthat.com and I just had a few
exceptions pop up. I don''t have a way to reproduce them, but my site
just was listed on lifehacker.com and these issues have popped up
under multiple concurrent users (only twice though which I think isn''t
too bad). I am using two lighttpd instances both with read/write
access to the index:
1) Error
2006 May 01
12
pagination in acts_as_ferret
I''m just wondering where I would put the pagination for search results
when using "acts_as_ferret".
At the moment my search code is..
def search
@query = params[:query] || ''''
unless @query.blank?
@results = Tutorial.find_by_contents @query
end
end
Cheers
SchmakO
--
Posted via http://www.ruby-forum.com/.
2006 Jul 07
5
link_to: link is missing id
I''m using a legacy table, where the unique id is not ''id''
I have a Model class like the following:
class Article < ActiveRecord::Base
set_primary_key "ARTICLE_ID"
end
however, using a link_to like the following (modified scaffolding),
the link has no id value:
<% for article in @articles %>
<tr>
<% for column in
2006 Mar 17
4
using ajax and layouts
Hi.
I copied the layout-example from agile web dev. in rails. When I want
to use ajax to create a search field including
<head><%= javascript_include_tag "prototype" %></head>
does''nt work when I include the line in my
app/views/layout/demo.rhtml. Name of controller is demo_controller.rb.
The search-field is in app/views/demo/observer.rthml and I have to
2006 Jul 05
1
Routing via function
I have a route that depends on a username being passed in the URL, such as:
map.connect '':username'', :controller => ''user'', :action => ''show''
Is there a way to perform a lookup of the username before matching on
this route?
I am hoping to be able to do something like this (completely made up):
:requirements => {:username =>
2006 Aug 02
4
Linking to the paginated items from search results.
Using Ferret for searching, I''ve got results that I need to link to.
Which is fine, except for that they''re displayed on paginated pages
using Rails paginate function - so it''s not like I can''t get it from the
database or anything else. Anyone have any ideas on how to go about
this? It''s not so much a coding problem as a theory problem, and I
2006 Apr 03
6
Installing Ferret locally on TextDrive
I would like to give the 0.9.0 version of Ferret a try on my
application hosted on TextDrive. I am currently running on the 0.3.2
version there.
Does anyone have any tips on installing it locally there? I know just
enough about Ruby gems to get by... but I am thinking it could be as
easy as passing a -i flag to specify the install location for ferret.
Then, the only thing I am not sure about
2006 May 30
3
Rebuild Indexes Issue
Hi,
I have some code to rebuild my ferret indexes but occasionally some
stale documents remain in the index even after rebuilding. The only
way I could find around this is to manually delete the index files
from the filesystem. Here is the code I have for rebuilding one of my
indexes for Gifts:
# delete existing entries
INDEX.size.times {|i| INDEX.delete(i)}
gifts =
2006 May 23
2
CSS not applied using apache
Hi all,
I have recently configured rails to run under apache. I''ve tried adding
a stylesheet using the stylesheet_link_tag function, however when I load
the page I do not see the affects of the stylesheet. The URL to the
stylesheet looks correct when viewing the page''s source. Has anyone
else seen this problem?
Thanks for your help,
Chris
--
Posted via
2006 Jun 29
13
find_by_contents not returning SearchResults?
The acts_as_ferret documentation says find_by_content returns an
instance of SearchResults, but I see this error when I try to use the
results.
undefined method `total_hits'' for []:Array
Here is the link to the documentation:
http://projects.jkraemer.net/acts_as_ferret/rdoc/classes/FerretMixin/Acts/ARFerret/ClassMethods.html#M000010
But here is the actual code:
result =
2006 Mar 30
6
Global Method Declaration?
Is there a place where I can put a method that can be accessed in both
views and controllers?
Here''s the situation, maybe someone can suggest a better way to go about this:
I created my own custom login system with email verification and user
roles (basically, I tinkered around with SaltedHashLoginGenerator
until I finally gave up and wrote my own). One role, of course, is an
admin
2006 May 04
5
How to install Ferret to get the best performance
Hey all,
After dabbling with ActiveSearch, we''re coming back around to take
another look at Ferret.
ActiveSearch slowed to a crawl after indexing about 20k documents, each
20 lines each.
This time we may attempt to create multiple Ferret indexes (isolating
each organization''s data individually), since we eventually could have
upwards of 20k documents for some
2006 Nov 23
2
Segmentation Faults
Hi,
I am using Ferret 0.9.4 and my index appears to be corrupt as any
attempt to read or write it causes a segmentation fault. I had been
using it with minimal problems for the past few months.
Is there a way to fix this without rebuilding the entire index? Since
I am on a shared host ferret takes too much memory to rebuild these
roughly 8500 records in one go and in the past I have had to
2006 May 17
3
What am I missing?
There''s got to be a simple answer to this...
def logout
reset_session
flash[:notice] = "Logged out"
redirect_to :action => ''index''
end
The flash never shows up, and doesn''t seem to be in the new session.
--Al Evans
--
Posted via http://www.ruby-forum.com/.
2006 Apr 05
7
Archive monthly count for blog
I am creating a blog to learn ruby on rails.
from the layout page i pass all the posts as a collection to
_archive.rhtml
<%= render :partial => "archive", :collection => @archive %>
On _archive.rhtml i have access to the collection. I am then gone to
render partial another page _archivecount.rhtml to display the number of
posts for each month.
Can anyone give a clue
2013 Jun 04
1
exec failure doesn't abort whole puppet transaction
I have my puppet defined as (pseudo code)
class A {
exec { somethingA:
}
}
class B {
exec { somethinB:
}
}
Class[''A''] -> Class[''B'']
the exec{ somethingA: } is actually failed on my setup, I was expecting the
whole puppet transaction would fail. To my surprise, class B still got
executed, and puppet agent returned with code 2
2006 Mar 30
2
Transactions with different types of model object
If i have three types of model objects, say an account, a person and a
tree :
account=Account.find(...
person=Person.find(...
tree=Tree.find(...
How do i start a transaction over the three of them. As far as i am
aware doing it like this only covers the account objects :
Account.transaction do
account.withdraw(20)
person.add_money(200)
tree.remove_leaves(23)
end
Any ideas??
Thanks,
2006 Apr 03
16
Dealing with Application error (Rails) in production
Hi all,
Week 2 working with Ruby on Rails... I have a working app in development
that is now throwing a generic, "Application error (Rails)" message in
production.
How do I deal with this so I can find more information about why the
error is being thrown in production, but not in development?
Thanks!
--
Posted via http://www.ruby-forum.com/.