Ruby on Rails Tuesday, November 30, 2010

onemore thing i am able to see by id like when i am at "http://
localhost:3000/ads/3" the add details are coming fine..

On Dec 1, 12:43 pm, kiran <venkatareddy...@gmail.com> wrote:
> i am not abe to see any thing...just able to see a white page without
> even a single dot in it..
>
> On Dec 1, 12:39 pm, rajeevsharma86 <rajeevsharm...@gmail.com> wrote:
>
>
>
>
>
>
>
> > are you able to see add by id and please
> > paste here you  log file output or error in deatils
>
> > On Wed, Dec 1, 2010 at 1:02 PM, kiran <venkatareddy...@gmail.com> wrote:
> > > Controller:ads_controller.rb
>
> > > class AdsController < ApplicationController
>
> > > def index
> > > @ads = Ad.find(:all)
> > > end
>
> > > def show
> > > @ad=Ad.find(params[:id])
> > > (params[:id])
> > >  end
>
> > > end
>
> > > routeing: route.rb
>
> > > ActionController::Routing::Routes.draw do |map|
> > >   map.connect '/ads/', :controller=>'ads', :action=>'index'
> > >   map.connect '/ads/:id', :controller=>'ads', :action=>'show'
> > > end
>
> > > action;index.html.erb
> > > <html>
> > > <head>
> > > <title>All Ads!!<title>
> > > </head>
> > > <body>
> > > <h1>All Ads!</h1>
> > > <ul>
> > > <% for ad in @ads %>
> > > <li><a href="/ads/<%=ad.id %>"><%=ad.name %> </a></li>
> > > <% end %>
> > > </ul>
> > > </body>
> > > </html>
>
> > > any one know mebay application on head first rails...i am practicing
> > > that one.
> > > this application is all about displaying the list of adds to the
> > > users.
> > > see the above code to display the available ads on an index page ..
> > > but the list of names of ads not displaying when i run this
> > > application
> > > at "http://localhost:3000/ads" whats wrong ...can anybody help me
> > > pls...
>
> > > --
> > > 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 this group, send email to
> > > rubyonrails-talk+unsubscribe@googlegroups.com<rubyonrails-talk%2Bunsubscrib e@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/rubyonrails-talk?hl=en.
>
> > --
> > Thanks:
> > Rajeev sharma
> > +919013155133

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

i am not abe to see any thing...just able to see a white page without
even a single dot in it..

On Dec 1, 12:39 pm, rajeevsharma86 <rajeevsharm...@gmail.com> wrote:
> are you able to see add by id and please
> paste here you  log file output or error in deatils
>
>
>
>
>
>
>
>
>
> On Wed, Dec 1, 2010 at 1:02 PM, kiran <venkatareddy...@gmail.com> wrote:
> > Controller:ads_controller.rb
>
> > class AdsController < ApplicationController
>
> > def index
> > @ads = Ad.find(:all)
> > end
>
> > def show
> > @ad=Ad.find(params[:id])
> > (params[:id])
> >  end
>
> > end
>
> > routeing: route.rb
>
> > ActionController::Routing::Routes.draw do |map|
> >   map.connect '/ads/', :controller=>'ads', :action=>'index'
> >   map.connect '/ads/:id', :controller=>'ads', :action=>'show'
> > end
>
> > action;index.html.erb
> > <html>
> > <head>
> > <title>All Ads!!<title>
> > </head>
> > <body>
> > <h1>All Ads!</h1>
> > <ul>
> > <% for ad in @ads %>
> > <li><a href="/ads/<%=ad.id %>"><%=ad.name %> </a></li>
> > <% end %>
> > </ul>
> > </body>
> > </html>
>
> > any one know mebay application on head first rails...i am practicing
> > that one.
> > this application is all about displaying the list of adds to the
> > users.
> > see the above code to display the available ads on an index page ..
> > but the list of names of ads not displaying when i run this
> > application
> > at "http://localhost:3000/ads" whats wrong ...can anybody help me
> > pls...
>
> > --
> > 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 this group, send email to
> > rubyonrails-talk+unsubscribe@googlegroups.com<rubyonrails-talk%2Bunsubscrib e@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.
>
> --
> Thanks:
> Rajeev sharma
> +919013155133

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

are you able to see add by id and please
paste here you  log file output or error in deatils

On Wed, Dec 1, 2010 at 1:02 PM, kiran <venkatareddy.cs@gmail.com> wrote:
Controller:ads_controller.rb

class AdsController < ApplicationController

def index
@ads = Ad.find(:all)
end

def show
@ad=Ad.find(params[:id])
(params[:id])
 end

end


routeing: route.rb

ActionController::Routing::Routes.draw do |map|
  map.connect '/ads/', :controller=>'ads', :action=>'index'
  map.connect '/ads/:id', :controller=>'ads', :action=>'show'
end


action;index.html.erb
<html>
<head>
<title>All Ads!!<title>
</head>
<body>
<h1>All Ads!</h1>
<ul>
<% for ad in @ads %>
<li><a href="/ads/<%=ad.id %>"><%=ad.name %> </a></li>
<% end %>
</ul>
</body>
</html>


any one know mebay application on head first rails...i am practicing
that one.
this application is all about displaying the list of adds to the
users.
see the above code to display the available ads on an index page ..
but the list of names of ads not displaying when i run this
application
at "http://localhost:3000/ads" whats wrong ...can anybody help me
pls...

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--
Thanks:
Rajeev sharma
+919013155133

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Marnen Laibow-Koser wrote in post #965154:
> Gregory Grimaux wrote in post #965148:
>> 0 down vote favorite
>>
>>
>> Hi, since several days I have this problem:
>>
>> For a few days it has worked and now I can't do it works again. I setup
>> a rails server on ubuntu with apache-2. I used a git repository to get
>> all new change. After I run
>> sudo rake db:migrate RAILS_ENV=production
>
> You shouldn't be using sudo for that.
>
OK I will not used sudo in future.
>>
>> But after have restart apache server I can see that rails use the
>> development db and not the production while before it has used it.
>
> Then you have not set your RAILS_ENV environment variable correctly.
> You can usually do that in the Apache config file.
>
> I assume you're using Passenger (and if not, you should). If I remember
> correctly, there is info in the Passenger docs on how to do this.
>>

I'm using passenger with apache2. In my sites I set
RailsEnv production

So I think it should be OK.

>> MORE INFO:
>> While I'm trying to understand the problem I note something: When I
>> execute rake db:migrate RAILS_ENV=production I can see that it create me
>> the production db.
>
> Right, because RAILS_ENV=production puts you in the production
> environment -- for that task only.
>
>> But if I add new value in db I can see it still used
>> development. I'm continuing my search on google :D. But if someone knows
>> the answer
>>
>> I don't really understand what can cause this. So i really appreciate
>> some help.
>
> Simple: as I explained above, environment variables are not being set
> correctly. When you specify an environment variable on the command
> line, it is only used for that command.
>
> Please gain a better understanding of how environment variable work in
> *nix.

I'm sorry I don't understand what you mean by *nix maybe you're talking
about nginx
>
> Best,
> --
> Marnen Laibow-Koser
> http://www.marnen.org
> marnen@marnen.org

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Controller:ads_controller.rb

class AdsController < ApplicationController

def index
@ads = Ad.find(:all)
end

def show
@ad=Ad.find(params[:id])
(params[:id])
end

end


routeing: route.rb

ActionController::Routing::Routes.draw do |map|
map.connect '/ads/', :controller=>'ads', :action=>'index'
map.connect '/ads/:id', :controller=>'ads', :action=>'show'
end


action;index.html.erb
<html>
<head>
<title>All Ads!!<title>
</head>
<body>
<h1>All Ads!</h1>
<ul>
<% for ad in @ads %>
<li><a href="/ads/<%=ad.id %>"><%=ad.name %> </a></li>
<% end %>
</ul>
</body>
</html>


any one know mebay application on head first rails...i am practicing
that one.
this application is all about displaying the list of adds to the
users.
see the above code to display the available ads on an index page ..
but the list of names of ads not displaying when i run this
application
at "http://localhost:3000/ads" whats wrong ...can anybody help me
pls...

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hmm i m looking into it Travis :-) Hope to get some help ... well thanks
buddy. I will get back to u all very soon :-)

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi All,

I am using rails 3.0 and i installed sphinx and added the following to
gemfile gem 'thinking-sphinx', '2.0.0', :require => 'thinking_sphinx'

My structure is like below:
==========================

Model:
=====

class User < ActiveRecord::Base
include ActionView::Helpers::UrlHelper

has_one :profile, :class_name => "UserProfile", :dependent => :destroy

has_many :game_attributes, :dependent => :destroy do
def game(user, gme,dt)
find(:all, :conditions => {:user_id => user.id, :game_id =>
gme.id, :date => dt})
end
end

has_and_belongs_to_many :interested_game,
:class_name => 'Game',
:join_table => 'interested_game_users',
:order => 'name'

define_index do
indexes login
indexes email
indexes admin
indexes staff
indexes game_attributes(:name), :as => :ga_name
indexes game_attributes.value, :as => :ga_value
indexes profile.gender, :as => :up_gender
has :id, created_at
end
end

Controller:
===========

Working query:
=============
"rake ts:in RAILS_ENV=development
rake thinking_sphinx:rebuild RAILS_ENV=development
rake ts:start RAILS_ENV=development
rake ts:stop RAILS_ENV=development"
are working fine...


When i put this query " @results = User.search '', :page =>
params[:page], :per_page => 10 " in controller, it producing the query,
i can able to see the results.

[1m[36mUser Load (0.1ms)[0m [1mSELECT `users`.* FROM `users` WHERE
(`users`.`id` IN (272, 275, 280, 281, 282, 283, 288, 289, 290, 291))[0m
@results [#<User
#.............................................................">]
==============ThinkingSphinx::Search= length==== 10

When i try the below query it will not generate result or produces
empty result...... When i try this same query with rails db console it
producing the data, so we sure that we have the data in database...
please help me on this.

query:
======
@results = User.search 'j', :page => params[:page], :per_page => 10,
:conditions => {:ga_gender =>'Female', :login => 'Someusename',
:ga_name=> 'some name', ga_value=>'some value'}, star =>true, :sort_mode
=> :extended, :order => "created_at DESC"

Which is not working or returns empty array set..


2. How to implement delta to update thinkg-sphinx automatically for some
period / any document/forums , etc..


Thanks in Advance,
Jak.

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

eugenio wrote in post #964246:
> I think you have to specify which fields ferret will index. Take a
> look at: https://github.com/jkraemer/acts_as_ferret (under "Usage").
> I got a lot of problems with ferret under production, you may consider
> switching to sphinx/thinking sphinx.

Hi thanks for the reply i tried sphinx, but i have following issue.

I am using rails 3.0 and i installed sphinx and added the following to
gemfile gem 'thinking-sphinx', '2.0.0', :require => 'thinking_sphinx'

My structure is like below:
==========================

Model:
=====

class User < ActiveRecord::Base
include ActionView::Helpers::UrlHelper

has_one :profile, :class_name => "UserProfile", :dependent => :destroy

has_many :game_attributes, :dependent => :destroy do
def game(user, gme,dt)
find(:all, :conditions => {:user_id => user.id, :game_id =>
gme.id, :date => dt})
end
end

has_and_belongs_to_many :interested_game,
:class_name => 'Game',
:join_table => 'interested_game_users',
:order => 'name'

define_index do
indexes login
indexes email
indexes admin
indexes staff
indexes game_attributes(:name), :as => :ga_name
indexes game_attributes.value, :as => :ga_value
indexes profile.gender, :as => :up_gender
has :id, created_at
end
end

Controller:
===========

Working query:
=============
"rake ts:in RAILS_ENV=development
rake thinking_sphinx:rebuild RAILS_ENV=development
rake ts:start RAILS_ENV=development
rake ts:stop RAILS_ENV=development"
are working fine...


When i put this query " @results = User.search '', :page =>
params[:page], :per_page => 10 " in controller, it producing the query,
i can able to see the results.

[1m[36mUser Load (0.1ms)[0m [1mSELECT `users`.* FROM `users` WHERE
(`users`.`id` IN (272, 275, 280, 281, 282, 283, 288, 289, 290, 291))[0m
@results [#<User
#.............................................................">]
==============ThinkingSphinx::Search= length==== 10

When i try the below query it will not generate result or produces
empty result...... When i try this same query with rails db console it
producing the data, so we sure that have the data... please help me on
this.

query:
======
@results = User.search 'j', :page => params[:page], :per_page => 10,
:conditions => {:ga_gender =>'Female', :login => 'Someusename',
:ga_name=> 'some name', ga_value=>'some value'}, star =>true, :sort_mode
=> :extended, :order => "created_at DESC"


2. How to implement delta to update thinkg-sphinx automatically for some
period / any document/forums , etc..


Thanks in Advance,
Jak.

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Let's say the uploaded PPT is belong to Document model, and it's pages
images are belong to DocumentPage model.

So you need to make Paperclip Processor, which you use in Document
model. Inside this Processor you need to:
1. Create tmp folders where you will perform all operations
2. Convert PPT to PDF using http://www.artofsolving.com/opensource/pyodconverter
3. Convert PDF to TIFF images using ImageMagick.
4. Process TIFF images with
Tesseract(http://code.google.com/p/tesseract-ocr/) to extract
keywords.
5. Convert TIFF to PNG
6. Create DocumentPage models passing PNG images and extracted
keywords as a parameters.
7. If all DocumentPage models are created, just go out of Processor to
let the Document model be created.

Here is the Processor
https://gist.github.com/723079
It's kinda messy and kinda belongs to my application, but you get the idea.

On Tue, Nov 23, 2010 at 6:31 AM, Andy <andymilk@gmail.com> wrote:
> Does anyone know of any gems or plugins that can take a PowerPoint and
> create images out of every slide and also access the text in each
> slide?
>
> --
> 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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Lille wrote in post #965224:
> Hi,
>
> My Rails app offers opportunities to try out models on a 'what-if'
> basis, where dependent associations can be modified to obtain
> alternative results for the parent. Is there a way to delete/destroy
> the member of a collection so that I can play around with the
> accordingly modified parent in memory, without actually committing the
> destruction of the collection member to the data store? Based on my
> read of the docs, there is no 'delete' counterpart to
> 'collection.build' for association members.

If it were my app, I think I'd do this differently: start a transaction
for the "what if" stuff, then either roll it back or commit it when
done.

>
> Thanks for any comment,
>
> Lille

Best,

-- 
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org

Sent from my iPhone

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Thanks Frank. I finally found this post on the forum
http://www.ruby-forum.com/topic/191857 that points out what you have. It
is interesting that the form_for declaration in the view has to be
something like follows

<% form_for @modelname do |f| %>

instead of

<% form_for :modelname do |f| %>

Don't yet understand why this makes a difference but that is what makes
the difference and posts data with nested model name appended with
"attributes" as you point below.

Thanks for the feedback - very much appreciated. Past that hurdle and
onto the next one.

-S

Frederick Cheung wrote in post #965073:
> On Nov 28, 10:08pm, skt <stibre...@gmail.com> wrote:
>
>> "chkhw"=>"1"}}
>>
>> "name" is a string field for filename in UploadedAttachments model (I
>> am going to use that model for storing uploaded attachments but taking
>> incremental steps - getting just the name for now) and
>> grade_section_id is passed in so I create the model through
>> ClassCalendar
>
> This data doesn't look like what the nested_attributes stuff looks
> like - I would expected it to be more like
> 'uploaded_attachments_attributes' => {{'0' => {'name' => 'Test 2'}}
>
> What does your form look like?
>
> Fred

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Please quote when replying.

Kai Schlamp wrote in post #965115:
> Thanks for the answers.
>
> One last general question. Where do you validate your parameters
> fetched by "params" that should be passed to models? Do you check them
> right away in the controller and give them cleaned up to the model, or
> do you just provide them as they are (maybe just put them in single
> variables) and let the model check them?

It's usually the model's job to validate. That's what the validates_*
methods are for.

Validation in the controller will lead to repetitive code scattered all
over the application.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Ok, don't panicm another wat to make the question:

id DreamWeaver i can do:

<iframe
src="file:///C:/druby/gestorweb/6465_p_61_620_15674.pdf"></iframe>

but in a ruby form (_frame_pdf.html.erb) i Can not do the same
<iframe
src="file:///C:/druby/gestorweb/6465_p_61_620_15674.pdf"></iframe>

If i inspect FireBug i get:

"try {
Element.update("frame_oc", " <iframe
src=\"file:///C:/druby/gestorweb/6465_p_61_620_15674.pdf\"></iframe>\n");
} catch (e) { alert('RJS error:\n\n' + e.toString());
alert('Element.update(\"frame_oc\", \" <iframe
src=\\\"file:///C:/druby/gestorweb/6465_p_61_620_15674.pdf\\\"></iframe>\\n\");');
throw e }"

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Frederick Cheung wrote in post #965072:
> On Nov 27, 3:30am, Tiesto <esau...@gmail.com> wrote:
>> Hi!!
>>
>> Somebody knows why throws me an exception??
>>
>
> Sounds to me like the soap response ruby is trying to parse for you
> contains an invalid date (eg Februrary 31st). Have you tried looking
> at the soap response before ruby parses it?
>
> Fred

Fred,

The response is correctly formed, I meant XML file, the problem looks
like it is after that, But we don´t know where..

Here I attach XML request and response... of the two API that are
linked.. the second one is the one that I said that is responding
correctly.

Attachments:
http://www.ruby-forum.com/attachment/5491/XML_MG.doc


--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 30 November 2010 14:42, Albert C. <lists@ruby-forum.com> wrote:
> Ok, lets begin, I'm newest, sorry because this is a low level question:
>
> If I have this, and of course I've saved before, this file in public dir
>
> <iframe src="public/6465_p_61_620_15674.pdf"></iframe>
>
> ¿Why doesn't work?

if it is in the public folder of your app then you just want
src="/6465_p_61_620_15674.pdf".

Colin

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Thanks for the answers.

One last general question. Where do you validate your parameters
fetched by "params" that should be passed to models? Do you check them
right away in the controller and give them cleaned up to the model, or
do you just provide them as they are (maybe just put them in single
variables) and let the model check them?

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Ok, lets begin, I'm newest, sorry because this is a low level question:

If I have this, and of course I've saved before, this file in public dir

<iframe src="public/6465_p_61_620_15674.pdf"></iframe>

¿Why doesn't work?

* this is called from "firmas" controller and "mostrar_pdf" action

=>the iframe says, if i have Javascript:
No route matches "/firmas/public/6465_p_61_620_15674.pdf"

=>and, if i haven't:
No route matches "/mostrar_pdf/public/6465_p_61_620_15674.pdf"


thanks a lot

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi there,

I'm using Action Caching with Rails 2.3.8 on Heroku with Memcached
(via Dalli Gem).

Without the layout parameter Action Caching works fine. However, as
soon as I add layout => false I get problems: Normal non-ajax requests
are cached fine, without the layout, as expected. But ajax requests
are not properly cached: I get cache misses all the time. Then, when I
log in to my app neither normal, nor ajax requests are cached at all.

I also tried to set :layout => Proc.new { |c| c.request.xhr? }
When I do that ajax and normal requests are properly cached (no matter
if logged out or logged in)
but normal requests also cache the layout. Seems odd to me as normal
requests should have :layout => false.
I'm trying to debug this for hours now, but I haven't got a clue
what's going on so far. What especially confuses me
is that the logged in state of my app apparently has an influence on
the caching behaviour.

Here is my full caching call (for the case of layout => false):

[code]caches_action :index, :layout => false,
:cache_path => Proc.new { |c|
c.params.clone.delete_if { |k,v| ['authenticity_token'].include?
(k) }.merge(:xhr => c.request.xhr? ? 't' : 'f') }[/code]

I'd greatly appreciate any help on this!

Nico

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 30 November 2010 14:10, PalaniKannan K <kpalanikannan@gmail.com> wrote:
> I need the results have to print without duplicates. This gives the results
> with duplicates.
<snip>
> and
<snip>
> presents same results with duplicates. Please about your suggestion.

I'm having trouble seeing where you're even trying to explain what you
have, and what you want....

Does this give what you're after? :
<%= @sp_references.map(&:all_references).flatten.map(&:reference).uniq.delete_if{|ref|
ref=~ /emend$/i}.join("<br/>") %>

To be honest, I'm just stabbing in the dark, because you've not
explained anything about what these objects are made of or what actual
end result you want to achieve... some pseudo-code would help...

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 30 November 2010 14:09, Albert C. <lists@ruby-forum.com> wrote:
> Hi, I'm looking for answers for the same problem.... and the solution
> therfore is?

What problem?

Colin

>
> => maybe read the file in the server and create it as a tmp file in
> public/
>
> ¿Is this a correct solution?
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Dear Michael,

Thanks lot for your answer.

<% @sp_references.each do |sp_ref| %>
 <%= sp_ref.all_references.map(&:reference).uniq.delete_if{|ref| ref
=~ /emend$/i}.join("<br/>") %>
<% end %>

I need the results have to print without duplicates. This gives the results with duplicates.

<% @sp_references.each do |sp_ref| %>
 <%= sp_ref.all_references.map(&:reference).delete_if{|ref| ref=~ /emend$/i}.join("<br/>") %>
<% end %>


and

<% @sp_references.each do |sp_ref| %>
 <%= sp_ref.all_references.map(&:reference).uniq.delete_if{|ref| ref=~ /emend$/i}.join("<br/>") %>
<% end %>


presents same results with duplicates. Please about your suggestion.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi, I'm looking for answers for the same problem.... and the solution
therfore is?

=> maybe read the file in the server and create it as a tmp file in
public/

¿Is this a correct solution?

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Anyone knows or worked with DragonFly gems to make photo upload? I have some issue with this: DragonFly doesn't cleanup yours tempfiles...


All the time that i get some file (I use fetch method from app), DragonFly create an new file in my tmp dir. 

Thanks
Andre


--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Do you remember the version of the gem(s) you had before you updated
them? There is a way to install specific gem versions by adding the
version at the end of the install command. Something like this:

gem install rails -v=2.3.5 # This would install Rails 2.3.5

You can also check the dependencies of the other installed gems to try
to figure out the version you might be missing. Check the
documentation at http://docs.rubygems.org/read/chapter/10#page78

On Nov 29, 3:01 pm, John <joben...@gmail.com> wrote:
> I've seen people post similar issues at various places, but I have yet
> to find an explanation on how to resolve this issue. I'm a new Rails
> user, so I need a little adult supervision please.
>
> I carelessly ran a "gem update" this morning and it updating a couple
> gems. Since that point, I've been unable to use rails. When I attempt
> to, I get the error:
> "/Library/Ruby/Site/1.8/rubygems.rb:779:in 'report_activate_error':
> RubyGem version error: builder(3.0.0 not ~> 2.1.2) (Gem::LoadError)"
>
> There were a few additional lines. If those would be helpful in
> troubleshooting this error, please let me know.
>
> As far as I can tell, this is a dependency issue. I tried uninstalling
> the builder gem and reinstalling it. That didn't fix the error. I
> tried uninstalling the rails gem and it's dependencies and reinstalled
> them all. That also didn't fix it. I'm at a loss for what to do.
>
> Your suggestions and guidance are appreciated.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails



On Tue, Nov 30, 2010 at 3:25 AM, Conor Nugent <lists@ruby-forum.com> wrote:
Hi Nick,

I think that you are right and the problem lies with your installation
of wkhtmltopdf given your command line problems. Maybe try uninstalling
wkhtmltopdf

apt-get remove wkhtmltopdf

and then installing via PDFKit

pdfkit --install-wkhtmltopdf

or manually

Sorry,  I know this isn't much help!

Right... also, when you say your pdf is blank --- does the file actually open or is it empty? I had a situation where I was getting empty files, which of course would not open. I'll try to remember what the solution was if you let me know what your situation is.
 


Nick Burdick wrote in post #964978:
> Conor Nugent wrote in post #963078:
>> Hi David,
>>
>> I'm really glad the post helped! Thank you for all your advise too!
>
> David, Conor,
>
> I tried to install via the method mentioned by Conor above and when I
> generate a PDF, it comes up blank.  I also try running from the command
> line and I also get a blank PDF.  It's really strange, when I installed
> the first time (into the default location) and I ran from command line,
> I got it to work with "wkhtmltopdf www.google.com goof.pdf" but it
> hasn't worked since.  I have a new MacBook, running rvm with ruby 1.8.7
> and rails 3.
>
> Any thoughts you have would be greatly appreciated.  I'm wondering if I
> somehow need to do a complete delete after the various attempts at
> installation, but I don't see anything else to delete aside from the
> wkhtmltopdf file in use/local/bin or the rvm directory.  Have either of
> you had to install the 64 bit version?
>
> Thanks,
> Nick

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

hi,

im trying to build a ajaxified remote_form_for. this looks like that:
<% remote_form_for :search, :url => { :action => "index"} , :method => "get" , :loading => "$('divSearchWiP').show();", :loaded => "$('divSearchWiP').hide();" do %>
...
<%= submit_tag "Search" %>

the form above sits in the index view. the index action does a page replaceL=:
          render :update do |page|   
                  page.replace_html 'divsearchResults', :partial => "results"
        end

Ruby on Rails

On Nov 28, 10:08 pm, skt <stibre...@gmail.com> wrote:

> In my create function in GradeSection controller I get data posted as
> such
>
> Processing GradeSectionController#create (for 127.0.0.1 at 2010-11-27
> 22:13:46) [POST]
>   Parameters:
> {"authenticity_token"=>"fwdgGanIsScNQUcm6sYc952xhT2BSVH6LXggOJdxhKo=",
> "class_calendar"=>{"dt"=>"Mon Dec 13 2010 22:13:35 GMT-0800 (Paci
> fic Standard Time)", "summary"=>"", "grade_section_id"=>"1",
> "chkproj"=>"0", "uploaded_attachments"=>{"name"=>"Test 2"},
> "chkhw"=>"1"}}
>
> "name" is a string field for filename in UploadedAttachments model (I
> am going to use that model for storing uploaded attachments but taking
> incremental steps - getting just the name for now) and
> grade_section_id is passed in so I create the model through
> ClassCalendar

This data doesn't look like what the nested_attributes stuff looks
like - I would expected it to be more like
'uploaded_attachments_attributes' => {{'0' => {'name' => 'Test 2'}}

What does your form look like?

Fred

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On Nov 27, 3:30 am, Tiesto <esau...@gmail.com> wrote:
> Hi!!
>
> Somebody knows why throws me an exception??
>

Sounds to me like the soap response ruby is trying to parse for you
contains an invalid date (eg Februrary 31st). Have you tried looking
at the soap response before ruby parses it?

Fred

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Model.create(:attr => "value") returns the "#<Model id: 1, attr: Value>"
if model is valid and no database's errors found. It is normal, but my
UserSkill returns "#<UserSkill id: nil, etc.. >" on create method.

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

>
> But other models returns the id on ".create()"

yes..

in this case method(".create()") first creates record in db table and
then it provides you hash with table's all attributes and values which
are there in db records.

-Ganesh K

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

> UserSkill.new # => { :id => nil, :user_id => nil, :skill_id => nil }
> us = UserSkill.create(:user_id => 1, :skill_id => 1) # => { :id => nil,
> :user_id => 1, :skill_id => 1 }
>
> Why id is nil?
> In the database record was created and id is not null...


Hi,

Friend when you create any "new" object usign UserSkill or any class
class
which is associated with ActiveRecords.. then it auto create one hash
with all attributes of user_skills(or any relevant) table.. this is due
to ORM feature of the Rails..

Second thing, that all values seems to nil in that hash.. this is
because it provide you blank hash.. to do process or to assign required
values to
the attributes..

nil is just because as we know ruby has greate feature of NilClass to
avoid exceptions on nil values..


I dont know is this answer of your question or not.

Good luck ;)

-Ganesh K.

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I want to update a div on my page with prototype (new Ajax.Updater
('my_div', 'page.html')).
What I do is:

.
.
<% = csrf_meta_tag%>
<% = javascript_include_tag: defaults%>
.
.
<% = yield%>
.
.

<% = link_to "Link", page_path,: remote => true%>

Without the :remote => true the div is updated but it does nothing.


Anybody can help me?
Thanks.

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Colin Law wrote in post #965064:
> On 30 November 2010 10:14, Yan Bernatsky <lists@ruby-forum.com> wrote:
>> Why id is nil?
>> In the database record was created and id is not null...
>
> The id is not allocated until the record is saved to the database.
>
> Colin

But other models returns the id on ".create()"

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 30 November 2010 10:14, Yan Bernatsky <lists@ruby-forum.com> wrote:
> I have 3 models
> Skill, User, UserSkill
>
> User has_many skills :through => :user_skills
> User has_many :user_skills
>
> UserSkill.new # => { :id => nil, :user_id => nil, :skill_id => nil }
> us = UserSkill.create(:user_id => 1, :skill_id => 1) # => { :id => nil,
> :user_id => 1, :skill_id => 1 }
>
> Why id is nil?
> In the database record was created and id is not null...

The id is not allocated until the record is saved to the database.

Colin

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

ps. rails 3.0.3

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I have 3 models
Skill, User, UserSkill

User has_many skills :through => :user_skills
User has_many :user_skills

UserSkill.new # => { :id => nil, :user_id => nil, :skill_id => nil }
us = UserSkill.create(:user_id => 1, :skill_id => 1) # => { :id => nil,
:user_id => 1, :skill_id => 1 }

Why id is nil?
In the database record was created and id is not null...

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Don't know if this is useful for you but just fixed that yesterday.
I was upgrading from rails 3.0.0 to 3.0.3 and starting "rails server"
complained about needing i18n 0.4.1 but 0.5.0 being active so I
reinstalled all rubies with rvm, removed all cached gems, reinstalled
rails and removed i18n 0.5.0 to leave only 0.4.1 there and it finally
worked.

Used Debian squeeze 64 bit, rvm, ruby 1.9.2-head, rails 3.0.3

Martin

On Nov 30, 1:17 am, Sarah Dunne <li...@ruby-forum.com> wrote:
> Andy,
>
> I have the same problem, trouble is i have never ever used command
> prompt in my life ,and am wondering how do i select option two to
> uninstall?
>
> --
> Posted viahttp://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

finally i fixed it..i had to make a single line as comment that is gem
'sqlite3-ruby', :require => 'sqlite3' in my gemfile ...any way thanx
for ur support..


On Nov 29, 10:05 pm, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
> Emanuel wrote in post #964744:
>
> > /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/bundler/
> > runtime.rb:64:in
> >  `require': no such file to load -- sqlite3 (LoadError)
>
> > u can see from the above line...i think it is an error regarding
> > sqlite3 as i am using it with my application...and i think heroku is
> > not supporting sqlite3...so what i have do now,,,
>
> Take that line out.  Heroku can figure out what database gems it needs
> without your help.
>
> Best,
> -- 
> Marnen Laibow-Koserhttp://www.marnen.org
> mar...@marnen.org
>
> Sent from my iPhone
>
> --
> Posted viahttp://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Anyone know how to add this patch?:
0001-enforced-utf-8-encoding-for-ruby-19-and-mysql-text.patch
(https://rails.lighthouseapp.com/projects/8994/tickets/4683-ascii-8bit-and-utf-8-in-hell)

I've never applied such a pacth.

Thanks

Gjermund

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 30 November 2010 05:27, gary <yangweining@gmail.com> wrote:
> Is there any way to create IP address range? like 192.168.0.1/24.
> It's too annoy to create a data each time.
> I find a Rubygems' ipaddress.
> http://rubygems.org/gems/ipaddress.
> I would like to take this to created IP range.
>
> in new.heml.erb
>
> <%= f.lable :iprange %>
> <%= f.text.field :iprange %>
>
> I don't how do used it in the rails' models
>
> ip = IPAddress("192.168.0.1/24")
> ip.each do |i|
>  p i.to_s
> end

Are you saying you do not know how to access the value from the text
field? It should be available in the controller in params.

Colin


Colin

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi Nick,

I think that you are right and the problem lies with your installation
of wkhtmltopdf given your command line problems. Maybe try uninstalling
wkhtmltopdf

apt-get remove wkhtmltopdf

and then installing via PDFKit

pdfkit --install-wkhtmltopdf

or manually

Sorry, I know this isn't much help!


Nick Burdick wrote in post #964978:
> Conor Nugent wrote in post #963078:
>> Hi David,
>>
>> I'm really glad the post helped! Thank you for all your advise too!
>
> David, Conor,
>
> I tried to install via the method mentioned by Conor above and when I
> generate a PDF, it comes up blank. I also try running from the command
> line and I also get a blank PDF. It's really strange, when I installed
> the first time (into the default location) and I ran from command line,
> I got it to work with "wkhtmltopdf www.google.com goof.pdf" but it
> hasn't worked since. I have a new MacBook, running rvm with ruby 1.8.7
> and rails 3.
>
> Any thoughts you have would be greatly appreciated. I'm wondering if I
> somehow need to do a complete delete after the various attempts at
> installation, but I don't see anything else to delete aside from the
> wkhtmltopdf file in use/local/bin or the rvm directory. Have either of
> you had to install the 64 bit version?
>
> Thanks,
> Nick

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

On 28 November 2010 22:08, skt <stibrewal@gmail.com> wrote:
> Folks,
>
> I am on Rails 2.3.8. I have models declared as below
>
> class GradeSection < ActiveRecord::Base
>  has_many  :class_calendars
>  <more stuff>
> end
>
> class ClassCalendar < ActiveRecord::Base
>  has_many :uploaded_attachments, :class_name => 'UploadedAttachment'
>  accepts_nested_attributes_for :uploaded_attachments
>  belongs_to  :grade_section
> end
>
> class UploadedAttachment < ActiveRecord::Base
>  belongs_to :class_calendar
>  has_attached_file :phile,
>        :url => "/assets/class_cal/:id/:style/:basename.:extension"
> end
>
> In my create function in GradeSection controller I get data posted as
> such
>
> Processing GradeSectionController#create (for 127.0.0.1 at 2010-11-27
> 22:13:46) [POST]
>  Parameters:
> {"authenticity_token"=>"fwdgGanIsScNQUcm6sYc952xhT2BSVH6LXggOJdxhKo=",
> "class_calendar"=>{"dt"=>"Mon Dec 13 2010 22:13:35 GMT-0800 (Paci
> fic Standard Time)", "summary"=>"", "grade_section_id"=>"1",
> "chkproj"=>"0", "uploaded_attachments"=>{"name"=>"Test 2"},

Since no one else has responded, and I don't know how it relates to
the error you are seeing, but I wonder whether this should be an array
of uploaded_attachments rather than a single instance.

Whether that is the issue or not, it might be worth removing the
attachements spec from the form initially just to check that you can
create a new object without the nested objects.

> "chkhw"=>"1"}}
>
> "name" is a string field for filename in UploadedAttachments model (I
> am going to use that model for storing uploaded attachments but taking
> incremental steps - getting just the name for now) and
> grade_section_id is passed in so I create the model through
> ClassCalendar
>
> When I get the above posted data, in the create function of
> GradeSectionController, I create a ClassCalendar object from params
> that are submitted as below
>
>  @cc = ClassCalendar.new(params[:class_calendar])  # line 96 in the
> code
>
> But this line gives me the following error
>
> #================= Error Message =======================
> ActiveRecord::AssociationTypeMismatch (UploadedAttachment(#90313070)
> expected, got Array(#1200170)):
>  app/controllers/grade_section_controller.rb:96:in `new'
>  app/controllers/grade_section_controller.rb:96:in `create'
>  c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-
> debug.rb:101:in `debug_load'
>  c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-
> debug.rb:101:in `debug_program'
>  c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.5/bin/rdebug-ide:
> 82
>  c:\ruby\bin\rdebug-ide:19:in `load'
>  c:\ruby\bin\rdebug-ide:19
>  -e:2:in `load'
>  -e:2
> #================= end error message =======================
>
> I may be missing something very simple but I don't understand the
> error and don't quite know how to debug this - getting an Array
> instead of UploadedAttachment. Looking for help with any pointers on
> what the issue is and how to debug such errors.

Do you know how to use reby-debug to break into your code and inspect
data and follow flow. You could break in before the offending line to
double check the data at that point. See the Rails Guide on debugging
if you are not familiar with this.

Colin

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hello,

first try RVM, it can solve this kind of problems easily.
Plase write here your ruby, gem, rails -v versions, and output of gem
list command. What OS you use?

You can check simply 'gem' command gives you how you can use this
command, and also 'gem -h' or 'gem --help' If you have multiple
versions of same gems, maybe you can try gem cleanup and the name of
the gem.

Write us more details, so we can help you easier.
Good luck,
Zoltán

On nov. 29, 20:01, John <joben...@gmail.com> wrote:
> I've seen people post similar issues at various places, but I have yet
> to find an explanation on how to resolve this issue. I'm a new Rails
> user, so I need a little adult supervision please.
>
> I carelessly ran a "gem update" this morning and it updating a couple
> gems. Since that point, I've been unable to use rails. When I attempt
> to, I get the error:
> "/Library/Ruby/Site/1.8/rubygems.rb:779:in 'report_activate_error':
> RubyGem version error: builder(3.0.0 not ~> 2.1.2) (Gem::LoadError)"
>
> There were a few additional lines. If those would be helpful in
> troubleshooting this error, please let me know.
>
> As far as I can tell, this is a dependency issue. I tried uninstalling
> the builder gem and reinstalling it. That didn't fix the error. I
> tried uninstalling the rails gem and it's dependencies and reinstalled
> them all. That also didn't fix it. I'm at a loss for what to do.
>
> Your suggestions and guidance are appreciated.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hello,

you can do these kind of things from console. Do you have SSH access
for your hosting? What kind of hosting is it?

First install the Haml gam:
gem install haml

Second write it to your Gemfile in your app's root folder:
gem 'haml'

Then try 'bundle install' in terminal.

If you have an error message its easier to go further. Please write it
here with your OS, gem list, versions you use.

Check these for Haml:
https://github.com/indirect/haml-rails
https://github.com/norman/haml-scaffold
http://haml-lang.com/

Good luck,
Zoltán

On nov. 30, 04:24, Ralph Shnelvar <li...@ruby-forum.com> wrote:
> Ok ... a long search on Google found something called
>   gem unpack
>
> Sadly, I am clueless how to use it ... what my current directory should
> be ... and how to point to it once I do the unpack.
>
> --
> Posted viahttp://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I think don't be afraid, just try it out! On your cpanel you can
delete anything if you find it unuseful.
You can also make a server on your machine, you will reach it as
localhost.

Also you can ask your hosting's support.

After you tried to make it work, and something has error message -
it's much easier to help you, since we know what is your problem.
Good luck,
Zoltán

On nov. 29, 22:05, thunda <ddccommunicati...@gmail.com> wrote:
> I am a complete novice when it comes to ruby and gems/rails.  I was
> wondering where I would go to get help installing this on my domain,
> so I can test it.
>
> http://github.com/maccman/holla
>
> paid or unpaid help sought?!
>
> Regards
>
> Thunda

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Marnen Laibow-Koser wrote in post #964957:

> Your problem is with RVM, not with Ruby or Rails.

And what is yours?

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

tundrax wrote in post #964969:
> Maybe your RVM is not running as a function that is causing gem env
> confusion.
> Check out the manual, Post Install section.
>
> Run "type rvm | head -n1" and check if the return is "rvm is a
> function". And if it's not, follow the instructions given in the
> manual.
> Hope this helps.

Thanks. :-)

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails Monday, November 29, 2010

Hi colin, 

as i have seen, authlogic does require default names like login, password etc. I was using t_login and t_password as i result getting these errors. 
I re-created my table with the new fields and everything works fine!!!

Home that helps someone else getting the same errors!!!

Thank you for your help!
Kostas
Κωνσταντίνος Λούπος
louposk@gmail.com


On Sat, Nov 27, 2010 at 2:36 PM, Colin Law <clanlaw@googlemail.com> wrote:
On 27 November 2010 12:21, Kostas L. <louposk@gmail.com> wrote:

Please don't top post, it makes it difficult to follow the thread.
Insert your reply into the previous post.  Thanks

> Hi colin,
> i have used these names because i have already created a php
> application using these names and i want to create the same
> application in rails.
> Its for a project in my university.
> I dont want to have different field names ..
> Do you think the problem is the names??? I dont think so...

Well the error message is NoMethodError, Model UserSession does not
respond to t_login which is saying the UserSession does not have a
method t_login, which suggests to me that the name is the problem.
Have you done something somewhere else in your code to tell Authlogic
to expect the different names?

It is easy enough to see if this is the problem here, just change
those few lines of code and see if that error goes away.

Colin

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

I am in the process of upgrading my app from Rails2 to Rails3.
My Rails2 app uses searchlogic heavily.
After googling i've come to know that searchlogic is not compatible
with Rails3 and need to use meta_search instead.

But i havent quite understood the usage of meta_search vis-a-vis
searchlogic.

If i have a User model with :name and :address fields, i am not able
to use the following methods with meta_search. What am i doing wrong?

ruby-1.9.2-p0 > User.name_null
NoMethodError: undefined method `name_null' for #<Class:
0x000000038d5ce0>
from /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/
active_record/base.rb:1008:in `method_missing'
from (irb):7
from /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/
rails/commands/console.rb:44:in `start'
from /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/
rails/commands/console.rb:8:in `start'
from /home/pratik/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/
rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

None of the methods like User.user_id_eq(1) or
User.name_equals("Blah") are working. I guess i havent understood the
usage of meta_search yet!

Ref:
meta_search https://github.com/ernie/meta_search

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Dear all,
pls dont mind for asking this...will somebody tell me the software and
hardware requirements of server and client for my rails
application(website)
well.. i am using ruby 1.9.2 and rails 3.0.3 and gem 1.3.7 and
mysql5..for my site development on my windows7...

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Is there any way to create IP address range? like 192.168.0.1/24.
It's too annoy to create a data each time.
I find a Rubygems' ipaddress.
http://rubygems.org/gems/ipaddress.
I would like to take this to created IP range.

in new.heml.erb

<%= f.lable :iprange %>
<%= f.text.field :iprange %>

I don't how do used it in the rails' models

ip = IPAddress("192.168.0.1/24")
ip.each do |i|
p i.to_s
end

Somebody can give me some guide.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Hi, dear guys!
I have following super simple program
dbh=DBI.connect("DBI:SQLite3:barron.db")
sth=dbh.prepare("INSERT INTO WORDS VALUES(?,?,?)")

3.times{
sth.execute("1","2","3")
}

and it gives me error :
/Users/tsdeng/.rvm/gems/ruby-1.8.7-p302/gems/sqlite3-ruby-1.3.1/lib/sqlite3/statement.rb:41:in `bind_param': library routine called out of sequence (SQLite3::MisuseException)
from /Users/tsdeng/.rvm/gems/ruby-1.8.7-p302/gems/sqlite3-ruby-1.3.1/lib/sqlite3/statement.rb:41:in `bind_params'
from /Users/tsdeng/.rvm/gems/ruby-1.8.7-p302/gems/sqlite3-ruby-1.3.1/lib/sqlite3/statement.rb:37:in `each'
from /Users/tsdeng/.rvm/gems/ruby-1.8.7-p302/gems/sqlite3-ruby-1.3.1/lib/sqlite3/statement.rb:37:in `bind_params'
from /Users/tsdeng/.rvm/gems/ruby-1.8.7-p302/gems/dbd-sqlite3-1.2.5/lib/dbd/sqlite3/statement.rb:71:in `bind_params'
from /Users/tsdeng/.rvm/gems/ruby-1.8.7-p302/gems/dbi-0.4.5/lib/dbi/handles/statement.rb:115:in `execute'
from words.rb:53
from words.rb:49:in `each'
from words.rb:49


I can avoid this error by not using prepared statement. But I want to use it!!! T_T

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

"gem install haml"

On Tue, Nov 30, 2010 at 9:54 AM, Ralph Shnelvar <lists@ruby-forum.com> wrote:
Ok ... a long search on Google found something called
 gem unpack

Sadly, I am clueless how to use it ... what my current directory should
be ... and how to point to it once I do the unpack.

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--
Thanks:
Rajeev sharma
+919013155133

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Thanks :)

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

Ok ... a long search on Google found something called
gem unpack

Sadly, I am clueless how to use it ... what my current directory should
be ... and how to point to it once I do the unpack.

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Ruby on Rails

basically you got two possibilities: 1. write the value into a session-variable   session[:object] = "some string or value"  2. pass your value as a parameter to some action and read params in your controller: view:   <%=  link_to "my_action" :controller => :bla, :action => :my_action, :object => "some string or value" %>


controller:   def my_action     puts params[:wtf]   end 


On Tue, Nov 30, 2010 at 9:46 AM, Paul Roche <lists@ruby-forum.com> wrote:
Sure. I have a page in (view\controller x) with an input field.
Submitting the form displays the value of the input field on this same
page.

There is a link on this page that connects to another page in a
different view/controller (view\controller y). I want to use the param
(input field value) as a conditon in a 'find' in the controller y. But I
am not yielding results. It's like the param is empty. I hope this makes
it a little clearer

--
Posted via http://www.ruby-forum.com/.

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.




--
Thanks:
Rajeev sharma
+919013155133

--
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 this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.