Can someone tell me how to manage the content in Admin panel? I have to
implement Content Management System in the admin panel.... but not
getting any idea of how to implement it.
Any help would be greatly appreciated.
Thanks,
Ruchita Sharma.
--
Posted via http://www.ruby-forum.com/.
What admin panel? If you're looking for content management, there are a
few CMS solutions implemented in Rails. Radiant is one and you can find
a number more if you search the archives for this group/ mailing list.
Cheers,
Mohit.
11/5/2007 | 9:21 PM.
yeah i have looked Radiant.... but not able to work it properly coz the
link that i am following does not give the exact description of how to
use it. I have also tried admin_pages_engine but again not able to
implement it properly. Can you tell me some other option???
What do you mean that Radiant is not able to work properly? It seems to
work absolutely fine for a couple of sites that I'm managing. The
documentation site on the Radiant site includes links to a few tutorials
that should help you get started.
Of course, a lot depends on what you want to do and what is required of
the site that you're designing. I don't think anyone can give you an
option if you're not clear (and don't tell us) what needs to be implemented.
Hi...
I am using this link "http://www.radiantcms.org/download/" U can check
that in this link when we click on install instructions it gives an
error. So I am not able to do the exact implementation.
The documentation is being migrated to another wiki. You can find all
the documentation for Radiant on the documentation site:
http://wiki.radiantcms.org/Documentation
Installation: http://wiki.radiantcms.org/Installation
Also, there are how-to articles and also tutorials. Just start at the
documentation page.
Cheers,
Mohit.
11/5/2007 | 9:46 PM.
Good Morning
Did you get any soln?
Mephisto,typo3 ,...
Here are some links
how to install radiant cms
->http://kb.mediatemple.net/article.php?id=152
deploying mephisto cms ->
https://support.railsmachine.com/index.php?pg=kb.page&id=13
http://mephisto.stikipad.com/help/
typo3->http://typo3.com/
http://typo3.blinklist.com/
cms tutorial -> http://www.rubyonrailscamp.com/Rails+CMS+Tutorial
http://www.rubymatters.com/ruby-cms.shtml
hi Abhimanyu,
Good Morning. Didn't get any soln yet. Wud try the links and let you
know.
Hi....Actually now am trying to implement CMS with fckeditor abut facing
a little difficulty. Have u ever used fckeditor with rails??
Wats aptana? Are you using it for content management???
Bye
yeah sure..... bbye
Aptana Radrails is an IDE for Rails Project Management and more...
However, AFAIK, it s not a CMS :-)
Can you tell me how to use FckEditor for CMS?
Good Morning
Have you check these
http://www.webmasterworld.com/content_management/3351469.htm
http://www.megite.com/url/:www_onlamp_com/pub/a/onlamp/2006/04/20/from-weblog-to-cms.html
http://joshuamcharles.com/xhtml/fckrails.php
Third one is a popular link
Do you have deepavali holiday
Good Morning,
Let me try these links.... wud let u know. Yes we have holidays on
friday,sat and sunday.
Hi Abhimanyu,
I have implemented it with fckeditor by saving saving in the database.
Tell me one thing how can we create a activate or deactivate button in
rails.
this is a code that I got . this is to hide a text box.try this for
button
<input type=text id=text1>
<input type=button value=hide onclick=hide()>
<input type=button value=show onclick=show()>
<script type=text/javascript>
function hide(){
document.getElementById('text1').style.visibility='hidden';
}
function show(){
document.getElementById('text1').style.visibility='visible';
}
</script>
Thanks for that Abhimanyu.
But I mean to say that.... how can we implement the functionality that
on clicking of a button admin can activate or deactivate the status of a
user.
I have to implement the functionality where the list of users is coming
and the admin can activate or deactivate the status of a user.
User ->table containing list of users
Hi, Thanks a lot Abhimanyu. Its working :)
I am very much happy for you.
By the way Happy Deepavali
I dont have a holiday
Thanks a lot. Why you dont have a holiday on Diwali?? That's sad :(
Happy Diwali to you too....
Which IDE are you using. Are you a fresher in IT
Am not working on any IDE. Using Jedit as an editor. I have an
experience of approximatly 1 year in IT but in Ruby around 5 months.
yeah jEdit provides intellisense. Its interface is gui. On which project
u r workin?
Okie bbye.
How are you today. Whats the new task for you?
Good Morning.
Well I have to implement the functionality to display thumbnail images
that I told you.
I have uploaded the image in two sizes thumbnail and inline but am not
able to display the thumbnail image..... trying for that. Wud let u
knw....
tell me if you need my help
yeah i need your help. I really dont knw how to display the thumbnail
image. I am saving the images in the temp folder and now am not able to
display the thumbnail image.
Why don't you use something like file_column or attachment_fu?
There's plenty of stuff on the internet on how to use file_column for
uploading images, creating thumbnails (you don't need to upload a
separate thumbnail) and displaying it all.
Take a look at the main home page for file_column - the code is there:
http://www.kanthak.net/opensource/file_column/
This shows how to display thumbnails:
http://wiki.rubyonrails.org/rails/pages/HowToUseFileColumn
Regards
Mohit.
No am not using dt.
Cheers,
Mohit.
11/8/2007 | 4:39 PM.
Hi... yes i have that folder. But I have defined the path in my upload
model. FILE_STORE_PATH = File.join(File.dirname(__FILE__), '/../temp/').
So images are saved in temp folder.
path is obviously inside the project folder. Its in app folder.
Can anybdy help me out? I am using the following tutorails for image
uploading and displaying:
http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent
But i am getting the error
SystemExit in AssetsController#new
exit
I must agree with Peter. First, half of this thread is personal
conversation between Abhi and Ruchita and should be taken off this
list. Second, the Rails-related talk is beginning to look more like
chat. You guys should try using IRC and join #rubyonrails on freenode.
Hi,
I need to select the last row from the database. For that am writing the
code:
@sorter = SortingHelper::Sorter.new self, %w(id), params[:id], 'id',
'DESC'
sort_by = params[:sort]
@content = Content.find :all, :order => sort_by, :limit => 1
but this coding is returning the value (#).
Can anyone tell me where i am wrong?
Any help would be greatly appreciated.
Thanks,
Ruchita
@content = Content.find (:all,:order => 'nameof the column DESC')
eg
if name of column is "name"
@content = Content.find (:all,:order => 'name DESC')
Thanks a lot. It worked.
Hi Abhimanyu,
I am implementing the functionality where i have to display the products
details as per user id. I have three tables users table, orders table
and line_items table. The fields are:
users table: id,first_name and so on.
orders table: id, user_id, first_name and so on.
line_items table: id, order_id, product_id, quantity and so on.
Now from these tables i have to display the product_id, quantity..... as
per user id. Please tell me how to implement this.
@product = Line_items.find_by_order_id("orderid")-fill the "orderid"
if there are more than one orders then
@product=Array.new
@orders = Order.find_by_user_id("userid")->fill the "userid"
@orders.each do |order|
@var = Line_items.find_by_order_id(order)
@product << @var
end
@product will have all the products that the user have ordered
it is throwing an error:
NoMethodError in UserController#search
undefined method `each' for #<Order:0x4723338>
Let me clear my reqt once again. I have three tables users, orders and
line_items. Orders table have user_id and line_items have order_id.
Now the following code is giving error:
uninitialized constant UserController::Line_items
def search
@orders = Order.find :all
session[:query] = params[:query].strip if params[:query]
if session[:query] and request.xhr?
@users = User.find(:all, :conditions => ["first_name LIKE ?",
"%#{session[:query]}%"], :order => "first_name ASC")
@product=Array.new
@users.each do |user|
@orders.each do |order|
if user.id == order.user_id
@id = order.id
@var = Line_items.find_by_order_id(@id)
@product << @var
render_text "a"
else
render_text "abc"
end
end
end
end
>
> Abhi Manyu wrote:
>> please send me the code
>
> Let me clear my reqt once again. I have three tables users, orders and
> line_items. Orders table have user_id and line_items have order_id.
> Now the following code is giving error:
> uninitialized constant UserController::Line_items
>
> def search
> @orders = Order.find :all
this is horribly inefficient
>
> session[:query] = params[:query].strip if params[:query]
> if session[:query] and request.xhr?
> @users = User.find(:all, :conditions => ["first_name LIKE ?",
> "%#{session[:query]}%"], :order => "first_name ASC")
> @product=Array.new
> @users.each do |user|
> @orders.each do |order|
> if user.id == order.user_id
> @id = order.id
> @var = Line_items.find_by_order_id(@id)
find_by_x is like a find :first. You probably want find_all_by_x
The class name is LineItem (if you're adhering to the usual
conventions).
If you've defined your relationships properly, you could do something
along the lines of
@product = @users.collect {|u| u.orders.collect(&:line_items)}.flatten
(eager loading those associations might be a good idea)
You seem to be stumbling over some really basic rails stuff. Find a
good book on rails and read and understand it. AWDWR is a popular
favourite, and there's a book you can get for free at http://www.sitepoint.com/books/rails1/freebook.php
Fred
I have defined all the associations. In line_item model i have defined
belongs_to :order and in order model I have defined belongs_to :user.
The error is:
NameError in UserController#search
uninitialized constant UserController::Line_items
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.3/lib/active_support/dependencies.rb:477:in
`const_missing'
C:/rails/herbaltea/app/controllers/user_controller.rb:88:in `search'
C:/rails/herbaltea/app/controllers/user_controller.rb:85:in `each'
C:/rails/herbaltea/app/controllers/user_controller.rb:85:in `search'
C:/rails/herbaltea/app/controllers/user_controller.rb:84:in `each'
C:/rails/herbaltea/app/controllers/user_controller.rb:84:in `search'
>
> Abhi Manyu wrote:
>> Hi check whether Line_items is the class name
>
> I have defined all the associations. In line_item model i have defined
> belongs_to :order and in order model I have defined belongs_to :user.
> The error is:
>
> NameError in UserController#search
>
Like I said before, if you are adhering to the conventions, the class
name is LineItem, not line_item or Line_item or Line_items
Fred
Sorry the class name is LineItem.
class LineItem < ActiveRecord::Base
belongs_to :order
end
Even then it is throwing the same error.
yeah sure.
def search
@orders = Order.find :all
session[:query] = params[:query].strip if params[:query]
if session[:query] and request.xhr?
@users = User.find(:all, :conditions => ["first_name LIKE ?",
"%#{session[:query]}%"], :order => "first_name ASC")
@product=Array.new
@users.each do |user|
@orders.each do |order|
if user.id == order.user_id
@id = order.id
@var = Line_items.find_by_order_id(@id)
@product << @var
render_text "a"
else
render_text "abc"
end
end
end
end
The error is:
NameError in UserController#search
uninitialized constant UserController::Line_items
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.3/lib/active_support/dependencies.rb:477:in
`const_missing'
C:/rails/herbaltea/app/controllers/user_controller.rb:88:in `search'
C:/rails/herbaltea/app/controllers/user_controller.rb:85:in `each'
C:/rails/herbaltea/app/controllers/user_controller.rb:85:in `search'
C:/rails/herbaltea/app/controllers/user_controller.rb:84:in `each'
C:/rails/herbaltea/app/controllers/user_controller.rb:84:in `search'
--
Posted via http://www.ruby-forum.com/.
I hve changed it.
Giving the same error.... it is giving this error coz there is no
association between users table and lineitems table. Is there any
solution for that?
>
> Ruchita Sharma wrote:
>> Abhi Manyu wrote:
>>> Hey you haven't changed
>>> @var = Line_items.find_by_order_id(@id)
>>
>> I hve changed it.
>
> Giving the same error.... it is giving this error coz there is no
> association between users table and lineitems table. Is there any
> solution for that?
Yes. create the association.
Fred
But how? I dont have a user_id in lineitems table.
>
> Frederick Cheung wrote:
>> On 13 Nov 2007, at 12:31, Ruchita Sharma wrote:
>>
>>> solution for that?
>> Yes. create the association.
>>
>> Fred
>
> But how? I dont have a user_id in lineitems table.
Read up on has_many :through
Fred
The code is:
@orders = Order.find :all
@lineitems = Lineitem.find :all
session[:query] = params[:query].strip if params[:query]
if session[:query] and request.xhr?
@users = User.find(:all, :conditions => ["first_name LIKE ?",
"%#{session[:query]}%"], :order => "first_name ASC")
@product=Array.new
@users.each do |user|
@orders.each do |order|
if user.id == order.user_id
@id = order.id
@var = @lineitems.find_by_order_id(@id)
@product << @var
render_text "a"
else
render_text "abc"
Now the error is:
undefined method `find_by_order_id' for #<Array:0x470c9a8>
Give breakpoint like this and check bvalue of @var also before that
replace
@product=Array.new with @product=Array.new()
Yeah i have given it. But now the value of product is coming #.
Hi,
I have checked the values. Value of @id=order.id.... here the value of
id is coming right. I have checked the log file as well. @var =
@lineitems.find_by_order_id(@id).... the query is also coming right in
log file. . i.e.SELECT * FROM lineitems WHERE (lineitems.`order_id` =
1),but again the value of @var is coming #
yes i did check the entries.
I have implemented the textbox to search the user by user name and then
displaying the products as per user id. So this code is to search the
user.
please check this code.... am not able to find why its not working.
@orders = Order.find :all
@lineitems = Lineitem.find :all
session[:query] = params[:query].strip if params[:query]
if session[:query] and request.xhr?
@users = User.find(:all, :conditions => ["first_name LIKE ?",
"%#{session[:query]}%"], :order => "first_name ASC")
#@product=Array.new
#@product = @users.collect {|u|
u.orders.collect(&:line_items)}.flatten
@product=Array.new()
breakpoint Lineitem.find_by_order_id(@id)
#@var = Lineitem.find_by_order_id(@id)
#breakpoint @var
@product << @var
render_text @product
else
render_text "andnddjhg"
whenever i give the breakpoint.... my website get hanged and i am not
able to view the results.
Moreover the user names are not unique.
let ur project folder's name be product let its location be c:
then in console
give like
c:\product\ruby script breakpointer
then run program and come to console
and you can see the value
then type exit there