Displaying 7 results from an estimated 7 matches for "article_controller".
Did you mean:
articles_controller
2006 Apr 06
7
LoginSystem : make @session available to models
Hello.
LoginSystem is cool, it populates the @session instance variable of
controllers with many useful info.
The fact is : it would be cool to let models know about the session,
too.
For instance, after_update and after_create callbacks could store *who*
did *what* on *what.
Aim : having ActiveRecord::Base::session defined, returning the @session
of the controller which manipulates the
2011 Mar 11
12
A file-upload suddenly seems to be nil
...topic/carrierwave/ergk9LaO68k>at
the carrierwave-group, but I''m beginning to think this rather is a
rails-issue than a problem with carrierwave. The problem''s this:
I have 2 models, ''article'' and ''upload''. article has_many :uploads. In my
article_controller i have an action named upload:
def upload
@article = Article.find(params[:id])
@article.uploads.create(params[:file])
render :nothing => true
end
this should save a file-upload to article.uploads. I''m using carrierwave to
save uploads in the upload-model, but that''s pr...
2006 Sep 26
3
concurrency / #search_each problem / segfault
Hello everyone,
I was stress-testing my application (running on Rails via FastCGI) by
letting two concurrent users (not human .. an app called ''siege'')
a) save an Article and b) search for all Articles.
I am searching via
Article.ferret_index.search_each( ..) do |doc_id,score|
doc = index[doc_id]
..
end
and writing via
Article.ferret_index <<
2006 Apr 12
0
How to get validates_presence_of worked in this situation?
...veRecord::Base
belongs_to :article
validates_presence_of :detail
end
In the submit form:
<%= text_field ''article'', ''body'' %>
<%= text_field ''assistarticle'', ''detail'' %>
The process logic will be done in article_controller
Now if the article.body field is empty,then validates_presence_of will
work and return the error to let user re-enter the body content,but if
the assistarticles.detail is empty,then no tips at all,and the
accordingly record will not be stored,either. How to let the latter
validates_presence_of...
2005 Nov 14
0
in_place_editor_field inside a partial collection
...this to a quite unrelated thread. Sorry for those
reading this twice.)
Did anybody succeeded in using "in_place_editor_field" inside a
partial collection?
It''s working perfectly in a regular template, but the id part becomes
blank when it''s inside a partial collection.
article_controller.rb:
class ArticleController < ApplicationController
in_place_edit_for :comment, :body
...
end
_comment.rhtml:
<li id="comment-<%= comment.id %>">
<%= in_place_editor_field :comment, :body %>
</li>
show.rhtml:
....
<ol id="comments">
<% unl...
2006 Jun 15
3
Need help creating a clever route
What I want to do is wrap all the scaffolded administrated pages for my
webapp into an admin folder in the controllers and views folders.
So...
/app
/controllers
/admin
issue_controller.rb
article_controller.rb
topic_controller.rb
... etc. ...
/views
/admin
/issue
_form.rhtml
edit.rhtml
list.rhtml
new.rhtml
show.rhtml
/article
/topic
... etc. ...
My question is how do I set up a good, clean route that can accomodate
thi...
2006 May 18
6
Newbie:problem when using validates*
Hi,
I have performed the cookbook tutorial. Before tailoring the views and
controllers, when I put in the model recipe.rb:
validates_uniqueness_of :title
validates_length_of :title, :within => 1...20
And I tried to introduce some new recipe without the above conditions I
got the message:
---------------------------------------------------
New recipe
1 error prohibited this category from