[Rails] How to define virtual attribute for date_select drop menu using active model

2012-08-13 Thread Loganathan Sellapa
Hi All,

I am using active model for payment process in my application , i am not
able to add field for date field, since it throws error as below *undefined
method `card_expiration_date(3i)='*.

*In model:
 * include ActiveModel::Validations
  include ActiveModel::Conversion
  extend ActiveModel::Naming*
*

  attr_accessor: card_expiration_date
*In view:*

<%=f.date_select :card_expiration_date, :add_month_numbers =>
false,:discard_day => true, :start_year => (Date.today.year-10), :end_year
=> (Date.today.year+10),:order=>[ :month,:year] %>


Any help would be appreciated.
regards,
Loganathan
ViewMe 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: How can I copy records from one table to another?

2012-08-13 Thread ZeroModulus
The number of records would vary widely.

I thought of doing deleted tables because I had already thought of having 
an attribute to mark a record as active, but figured I would have to write 
an exclusion clause every time.

Would there be a way to do this without having to write exclusion clauses 
for every query?

On Monday, August 13, 2012 8:20:12 PM UTC-7, Agoofin wrote:
>
> How many records are you talking about?
>
> For a few records, once in a while, you could do it in Ruby - Google using 
> ActiveRecord outside of Rails for some more info.
>
> Why do you have deleted tables? You might consider adding a field like 
> "Active" and filter the non active records
>
> On Monday, August 13, 2012 10:42:10 PM UTC-4, ZeroModulus wrote:
>>
>> For every table in my app there is a corresponding deleted_.* table. I 
>> would like to be able to copy a record to its corresponding deleted_.* 
>> table. How might I achieve this?
>>
>> If I have to have models for a deleted record, could I use some 
>> metaprogramming magic to create these models? How would I do that if so?
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/MQdIkzqrAAgJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: How can I copy records from one table to another?

2012-08-13 Thread Agoofin
How many records are you talking about?

For a few records, once in a while, you could do it in Ruby - Google using 
ActiveRecord outside of Rails for some more info.

Why do you have deleted tables? You might consider adding a field like 
"Active" and filter the non active records

On Monday, August 13, 2012 10:42:10 PM UTC-4, ZeroModulus wrote:
>
> For every table in my app there is a corresponding deleted_.* table. I 
> would like to be able to copy a record to its corresponding deleted_.* 
> table. How might I achieve this?
>
> If I have to have models for a deleted record, could I use some 
> metaprogramming magic to create these models? How would I do that if so?
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/fvDlEkHRflsJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Rails authorization system

2012-08-13 Thread Jean-Sébastien D.
This is more just a question of concepts. I have read extensively in
ruby and although many question are still itchy, I am wondering if
making my own authentication is the best. A person told me to follow the
tutorial on http://ruby.railstutorial.org/chapters/ in which I did.
However the authentication system is kinda basic and i am just wondering
if I should follow this tutorial

  - http://erniemiller.org/2008/09/30/easy-role-based-authorization/,
  - Device
  - Cancan.

I personally don't understand gems and are a black hole for me, hence i
prefer making my own authentication system based on that tutorial.
Although device and cancan are well though and seem to fit in well. I am
wondering if the tutorial of ernie covers most security feature that an
authorization system and also by combining it with ( rails book) or
should I worry about more security feature or Its so out-of-date that
device or cancan should be only my consideration.

I am looking for though or suggestion.
Thanks in advanced

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] How can I copy records from one table to another?

2012-08-13 Thread ZeroModulus
For every table in my app there is a corresponding deleted_.* table. I 
would like to be able to copy a record to its corresponding deleted_.* 
table. How might I achieve this?

If I have to have models for a deleted record, could I use some 
metaprogramming magic to create these models? How would I do that if so?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/s493BIL0x0AJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: NoMethodError: undefined method `accept' for nil:NilClass

2012-08-13 Thread ZeroModulus
I fixed the problem by removing activerecord-mysql2-adapter from my Gemfile 
and using only mysql2.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/1oHa1Qs1SAcJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] NoMethodError: undefined method `accept' for nil:NilClass

2012-08-13 Thread ZeroModulus
Here's the trace,

NoMethodError: undefined method `accept' for nil:NilClass
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
 
`to_sql'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:89:in
 
`insert'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in
 
`insert'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/relation.rb:66:in
 
`insert'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/persistence.rb:363:in
 
`create'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/timestamp.rb:57:in
 
`create'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/callbacks.rb:268:in
 
`block in create'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:403:in
 
`_run__3940325652772678349__create__4360101769414794529__callbacks'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in
 
`__run_callback'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in
 
`_run_create_callbacks'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in
 
`run_callbacks'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/callbacks.rb:268:in
 
`create'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/persistence.rb:344:in
 
`create_or_update'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/callbacks.rb:264:in
 
`block in create_or_update'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:403:in
 
`_run__3940325652772678349__save__4360101769414794529__callbacks'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in
 
`__run_callback'
... 4 levels...
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/validations.rb:50:in
 
`save'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/attribute_methods/dirty.rb:22:in
 
`save'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:241:in
 
`block (2 levels) in save'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:295:in
 
`block in with_transaction_returning_status'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
 
`transaction'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:208:in
 
`transaction'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:293:in
 
`with_transaction_returning_status'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:241:in
 
`block in save'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:252:in
 
`rollback_active_record_state!'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.2.3/lib/active_record/transactions.rb:240:in
 
`save'
from (irb):7
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands/console.rb:47:in
 
`start'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands/console.rb:8:in
 
`start'
from 
/Users/blaine/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands.rb:41:in
 
`'
from script/rails:6:in `require'
from script/rails:6:in `'ruby-1.9.2-p290 :008 > ^D

>From other sources on the web I found I should run the following,

$ bundle update activerecord-mysql2-adapter mysql2

I had the latest versions of these gems already, but I get the same error.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/sMfRZLkoLO8J.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Onmouseover similar to any Clothing Store?

2012-08-13 Thread Chunlong Z.
casual clothing Online and wholesale clothing Online are all here. Just
click “http://www.martofchina.com>cheap clothing” to have a
look.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Restfull custom actions

2012-08-13 Thread Jean-Sébastien D.
Paul wrote in post #1072262:
> I think you want "member" instead of "collection" in your route file.
> Collection is used when you don't have an id; member when you do. In
> your controller you are using the id, so I'm assuming that this is the
> URL you want: http://localhost:3000/customers/1/friend

Yeah thank to both of you, member was best and works now :D

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Diff-testing? (Acceptance testing for laziness and legacy-ness)

2012-08-13 Thread ☈king
A decent design would be:

- A gem that helps you manage the spider/diff/commit loop
- Gems that depend on that one to:
  - Use Capybara to help you spider web stuff better
  - Loop over invocations of CLI tools
  - Record various environments (that is, if you're testing a tool that's 
system-dependent, it would be good to be able to record the last time the 
run was snapshotted on various systems)

I have a few more ideas about it.

If you know of anything like this, or if you want to pair program on the 
creation of it, let me know.

—☈

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/Tj1sscVEDFwJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Diff-testing? (Acceptance testing for laziness and legacy-ness)

2012-08-13 Thread ☈king
I've come across a pattern where I'm working on some system without formal 
acceptance testing, but it's known to be good in its current state.

My favorite way to quickly get to a place where I don't regress is to 
spider the existing system, then save its output in text form, in the 
repository (usually in a directory called `greenbar/`).

This is useful for web systems, capturing the HTML, but it's also useful 
for any system that at some point passes through a flattened-to-text output.

I plan on either using or writing a more generalized system. Do you know of 
one, or should I go ahead and write it?


An example of a project that does this is here: 
https://github.com/exad/zu/blob/master/test/run

With almost no intervention the tests end up producing a pretty thorough 
coverage.


Of course, this does not replace more detailed acceptance testing, and 
certainly does not replace unit testing, but it can be a useful tool.

Thanks,
—☈

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/giqfoUQMjXkJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] how to do form parameter naming from the form tag?

2012-08-13 Thread Lille

>
> I would say though that you should use form_for rather than form_tag 
> if possible.  So if the form is displaying data for an object then use 
> form_for. 
>

There was no especially good reason to try for this, except I happened to 
have a form that used form_tag and with no instance variable available for 
use with form_for.

Anyway, let me close this issue, noting that my conclusion is that there is 
no way to get parameter naming with form_tag like from form_for. 

Lille 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/UhT85yoWYSEJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Restfull custom actions

2012-08-13 Thread Paul
I think you want "member" instead of "collection" in your route file.
Collection is used when you don't have an id; member when you do. In
your controller you are using the id, so I'm assuming that this is the
URL you want: http://localhost:3000/customers/1/friend

On Mon, Aug 13, 2012 at 3:42 PM, Colin Law  wrote:
> On 13 August 2012 19:11, Jean-Sébastien D.  wrote:
>> I am trying to add a custom restful action. I have try the following
>> tutorial but stil get an error and not sure why
>> http://guides.rubyonrails.org/routing.html,
>> http://railscasts.com/episodes/35-custom-rest-actions
>>
>> Here what i am trying to do in my model customer
>>
>> i have def the following
>>
>> def friend
>> @customer = Customer.find(params[:id])
>> end
>> Here my route
>>
>>   resources :customers do
>>   collection do
>> get 'friend'
>>   end
>> end
>> Here the link i try so far
>>
>> http://localhost:3000/customers/friend
>> http://localhost:3000/customers/1/friend
>> I also try member but same error occurs. There error is follow
>>
>> ActiveRecord::RecordNotFound in CustomersController#friend
>>
>> Couldn't find Customer without an ID
>
> That probably means that params[:id] is nil for some reason.  First
> check in development.log where it will show you the parameters passed
> in when you open the url.  Then you will know whether the id is not
> being passed in or whether you are loosing it somewhere along the way.
>  Next have a look at the Rails Guide on debugging to see techniques
> that you can use to debug the code.
>
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] how to do form parameter naming from the form tag?

2012-08-13 Thread Colin Law
On 13 August 2012 20:50, Lille  wrote:
> Hi,
>
> Just like with input tags in a form, where parameter naming can be
> influenced by modifying the tag name attribute...
>
> 
>
> ...results in...
>
> {'person' => {'name' => 'Henry'}}
>
> (source: guides.rubyonrails.org/form_helpers.html#basic-structures)
>
> Can I insert attributes into form_tag to customize the parameterization of
> all items inside? For example,
>
> {'whatever_i_want_to_use_as_a_key' => {'person' => {'name' => 'Henry'}}}

Yes it should work.  Did you try it?

I would say though that you should use form_for rather than form_tag
if possible.  So if the form is displaying data for an object then use
form_for.

If you are a beginner then, if you have not already done so, I suggest
you work right through some tutorials such as railstutorial.org (which
is free to use online), that will give you a good basic knowledge of
rails.  Make sure you use a tutorial for rails 3 and install the
correct version of Rails.

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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: how to do form parameter naming from the form tag?

2012-08-13 Thread Tim Shaffer
Sorry, should have been  "something[person][name]" instead of  
 "something[session][email]"

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/9CdjxUpV5OsJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: how to do form parameter naming from the form tag?

2012-08-13 Thread Tim Shaffer
You can use the "as" option on your form_for tag:

form_for(@person) will generate inputs like "person[name]"

form_for(@person, :as => "something[person]") will generate an input like 
"something[session][email]"

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/sjyTBLr04kUJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] how to do form parameter naming from the form tag?

2012-08-13 Thread Lille
Hi,

Just like with input tags in a form, where parameter naming can be 
influenced by modifying the tag name attribute...



...results in...

{'person' => {'name' => 'Henry'}}

(source: guides.rubyonrails.org/form_helpers.html#basic-structures)

Can I insert attributes into form_tag to customize the parameterization of 
all items inside? For example,

{'whatever_i_want_to_use_as_a_key' => {'person' => {'name' => 'Henry'}}}

Thx,

Lille


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/b8-V7wRzu_kJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Restfull custom actions

2012-08-13 Thread Colin Law
On 13 August 2012 19:11, Jean-Sébastien D.  wrote:
> I am trying to add a custom restful action. I have try the following
> tutorial but stil get an error and not sure why
> http://guides.rubyonrails.org/routing.html,
> http://railscasts.com/episodes/35-custom-rest-actions
>
> Here what i am trying to do in my model customer
>
> i have def the following
>
> def friend
> @customer = Customer.find(params[:id])
> end
> Here my route
>
>   resources :customers do
>   collection do
> get 'friend'
>   end
> end
> Here the link i try so far
>
> http://localhost:3000/customers/friend
> http://localhost:3000/customers/1/friend
> I also try member but same error occurs. There error is follow
>
> ActiveRecord::RecordNotFound in CustomersController#friend
>
> Couldn't find Customer without an ID

That probably means that params[:id] is nil for some reason.  First
check in development.log where it will show you the parameters passed
in when you open the url.  Then you will know whether the id is not
being passed in or whether you are loosing it somewhere along the way.
 Next have a look at the Rails Guide on debugging to see techniques
that you can use to debug the code.

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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Restfull custom actions

2012-08-13 Thread Jean-Sébastien D.
I am trying to add a custom restful action. I have try the following
tutorial but stil get an error and not sure why
http://guides.rubyonrails.org/routing.html,
http://railscasts.com/episodes/35-custom-rest-actions

Here what i am trying to do in my model customer

i have def the following

def friend
@customer = Customer.find(params[:id])
end
Here my route

  resources :customers do
  collection do
get 'friend'
  end
end
Here the link i try so far

http://localhost:3000/customers/friend
http://localhost:3000/customers/1/friend
I also try member but same error occurs. There error is follow

ActiveRecord::RecordNotFound in CustomersController#friend

Couldn't find Customer without an ID
Thanks in advance

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: [JOB] Ruby on Rails Positions at IBM (co-op and full-time)

2012-08-13 Thread Bill Walton
Please reply directly to the OP, not to the list.

On Mon, Aug 13, 2012 at 11:11 AM, kishore s.  wrote:

> Hello,
>
>  I am kishore i completed my ruby on rails course I heard that IBM
> is looking for ruby on rails developer.I am writing to express my
> sincere interest in securing employment with your organization.I would
> like to offer my service to your organization.My resume is enclosed for
> your kind review.Thank you for your attention and time. I certainly look
> forward to hear from you.
>
> Attachments:
> http://www.ruby-forum.com/attachment/7677/Kishore.R_resume.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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: [JOB] Ruby on Rails Positions at IBM (co-op and full-time)

2012-08-13 Thread kishore s.
Hello,

 I am kishore i completed my ruby on rails course I heard that IBM 
is looking for ruby on rails developer.I am writing to express my 
sincere interest in securing employment with your organization.I would 
like to offer my service to your organization.My resume is enclosed for 
your kind review.Thank you for your attention and time. I certainly look 
forward to hear from you.

Attachments:
http://www.ruby-forum.com/attachment/7677/Kishore.R_resume.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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Junior Rails developer looking for remote work.

2012-08-13 Thread Gintautas Šimkus
Oh, well then you should look into behavior / test driven development and
testing (for JS) tools similar to http://pivotal.github.com/jasmine/

Also you must learn CoffeeScript as it comes bundled with Rails (also it is
very good ;),
Next you should learn jQuery

With Jasmine + CoffeeScript + jQuery knowledge (and possible another
library like Cucumber) you'll be able to do A LOT, IMO (just because BBD is
so powerful).

2012/8/13 Weston Platter 

> @Dihital. Right. But being a Jr RoR freelance dev, what's a good benchmark
> to shoot for in establishing myself as JS competent developer?
>
>
> On Monday, August 13, 2012 8:59:10 AM UTC-5, Dihital wrote:
>
>> One might need non of those skills at all in a general case; it depends
>> on the job opening, really. That's how your question was phrased to my
>> knowledge. As to this particular job, I've no idea.
>>
>> 2012/8/13 Weston Platter 
>>
>>> What's the general level of Backbone JS does a typical Jr RoR
>>> subcontractor need?
>>>
>>>
>>> On Friday, August 10, 2012 6:26:37 AM UTC-5, Howser99 wrote:

 Hi Agis,

 Do you have much experience with Coffeescript / Backbone JS?

 On Friday, August 10, 2012 9:12:53 PM UTC+10, Agis A. wrote:
>
> I'm doing Ruby & Rails development for almost a year now and I'm
> loving it! I've also done 2 commercial projects (their source is in 
> private
> github repos, I can provide it if needed) and I'm currently looking for a
> job.
>
> Thanks.
>
> Github: http://github.com/Agis
> Blog: http://agis.heroku.com
> Twitter: 
> http://twitter.com/**corestudios**net
>
> Sample app: http://shoply.herokuapp.com (it's in Greek)
>
  --
>>> 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 rubyonra...@googlegroups.**com.
>>> To unsubscribe from this group, send email to rubyonrails-ta...@**
>>> googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/**
>>> msg/rubyonrails-talk/-/**OASZZkNOauUJ
>>> .
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>  --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/ZB7PHLqXwK4J.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Junior Rails developer looking for remote work.

2012-08-13 Thread Weston Platter
@Dihital. Right. But being a Jr RoR freelance dev, what's a good benchmark 
to shoot for in establishing myself as JS competent developer?


On Monday, August 13, 2012 8:59:10 AM UTC-5, Dihital wrote:
>
> One might need non of those skills at all in a general case; it depends on 
> the job opening, really. That's how your question was phrased to my 
> knowledge. As to this particular job, I've no idea.
>
> 2012/8/13 Weston Platter >
>
>> What's the general level of Backbone JS does a typical Jr RoR 
>> subcontractor need?
>>
>>
>> On Friday, August 10, 2012 6:26:37 AM UTC-5, Howser99 wrote:
>>>
>>> Hi Agis,
>>>
>>> Do you have much experience with Coffeescript / Backbone JS?
>>>
>>> On Friday, August 10, 2012 9:12:53 PM UTC+10, Agis A. wrote:

 I'm doing Ruby & Rails development for almost a year now and I'm loving 
 it! I've also done 2 commercial projects (their source is in private 
 github 
 repos, I can provide it if needed) and I'm currently looking for a job.

 Thanks.

 Github: http://github.com/Agis
 Blog: http://agis.heroku.com
 Twitter: 
 http://twitter.com/**corestudiosnet

 Sample app: http://shoply.herokuapp.com (it's in Greek)

>>>  -- 
>> 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 
>> rubyonra...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> rubyonrails-ta...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/rubyonrails-talk/-/OASZZkNOauUJ.
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>   
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/ZB7PHLqXwK4J.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Re: Junior Rails developer looking for remote work.

2012-08-13 Thread Gintautas Šimkus
One might need non of those skills at all in a general case; it depends on
the job opening, really. That's how your question was phrased to my
knowledge. As to this particular job, I've no idea.

2012/8/13 Weston Platter 

> What's the general level of Backbone JS does a typical Jr RoR
> subcontractor need?
>
>
> On Friday, August 10, 2012 6:26:37 AM UTC-5, Howser99 wrote:
>>
>> Hi Agis,
>>
>> Do you have much experience with Coffeescript / Backbone JS?
>>
>> On Friday, August 10, 2012 9:12:53 PM UTC+10, Agis A. wrote:
>>>
>>> I'm doing Ruby & Rails development for almost a year now and I'm loving
>>> it! I've also done 2 commercial projects (their source is in private github
>>> repos, I can provide it if needed) and I'm currently looking for a job.
>>>
>>> Thanks.
>>>
>>> Github: http://github.com/Agis
>>> Blog: http://agis.heroku.com
>>> Twitter: 
>>> http://twitter.com/**corestudiosnet
>>>
>>> Sample app: http://shoply.herokuapp.com (it's in Greek)
>>>
>>  --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/OASZZkNOauUJ.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Junior Rails developer looking for remote work.

2012-08-13 Thread Weston Platter
What's the general level of Backbone JS does a typical Jr RoR subcontractor 
need?

On Friday, August 10, 2012 6:26:37 AM UTC-5, Howser99 wrote:
>
> Hi Agis,
>
> Do you have much experience with Coffeescript / Backbone JS?
>
> On Friday, August 10, 2012 9:12:53 PM UTC+10, Agis A. wrote:
>>
>> I'm doing Ruby & Rails development for almost a year now and I'm loving 
>> it! I've also done 2 commercial projects (their source is in private github 
>> repos, I can provide it if needed) and I'm currently looking for a job.
>>
>> Thanks.
>>
>> Github: http://github.com/Agis
>> Blog: http://agis.heroku.com
>> Twitter: http://twitter.com/corestudiosnet
>>
>> Sample app: http://shoply.herokuapp.com (it's in Greek)
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/OASZZkNOauUJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: Re: Re: trouble with new app in rails

2012-08-13 Thread Sebastjan H.
ANIKET KADAM wrote in post #1072154:
> See Sebastjan H. i m also new to rails, but a week ago i installed
> Ubuntu
> 12.04 for rails development from the link below
>
> 
http://blog.sudobits.com/2012/05/02/how-to-install-ruby-on-rails-in-ubuntu-12-04-lts/
>
> its very good step by step installation process
>
> and i have installed from above link
> i m using => ruby1.9, rails => 3.2.7

I followed the guide you recommended and it works like a charm now.

Thank you and kind regards,
seba

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Using Jquery plugin "tokenInput" with rails

2012-08-13 Thread Colin Law
On 13 August 2012 10:52, sumit srivastava  wrote:
> ...
> I verified the html for the view. No error related to the form was found.
> What else could be the problem?

Make sure there are no errors at all, if there are any errors anywhere
on the page you cannot be sure that anything will work, as the browser
is having to guess what you meant and sometimes it gets it wrong.  It
is the most basic rule of debugging, first fix all the problems that
are clearly identified.  You cannot imagine the amount of time that is
wasted trying to track down a tricky bug, whilst saying "that simple
error that I know about cannot possibly cause this other problem in an
entirely different bit of code" which in the end turns out to be a
side effect of the first problem.  So fix all the html validation
problems first.  It may not fix the submit problem but you have to do
it sometime after all, so do it now.

The next time you find a website that is behaving strangely or does
not look right then paste the url into the validator (I expect you saw
that you can give it a url rather than paste in the code) and it is
very likely there are errors.  The site may well have been tested in
one browser and the errors did not appear to matter.  Using another
browser, or even a update to the browser, can change the way it
interprets invalid html and the page breaks.

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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Using Jquery plugin "tokenInput" with rails

2012-08-13 Thread sumit srivastava
On 13 August 2012 15:09, Colin Law  wrote:

> On 13 August 2012 10:19, sumit srivastava 
> wrote:
> >
> >>
> >
> > On 13 August 2012 14:33, Colin Law  wrote:
> >>
> >> On 13 August 2012 09:45, Sumit Srivastava <
> sumit.theinvinci...@gmail.com>
> >> wrote:
> >> >
> >> >
> >> > On Monday, 13 August 2012 14:02:11 UTC+5:30, Colin Law wrote:
> >> >>
> >> >> On 13 August 2012 08:40, sumit srivastava 
> >> >> wrote:
> >> >> > I went through the log. The contact_tokens parameter is being
> passed
> >> >> > as
> >> >> > nil,
> >> >> > i.e., "contact_tokens"=>"".
> >> >> >
> >> >> > This is happening even when the text field is actually populated.
> >> >>
> >> >> Can you post that section of the log please.  (And please don't top
> >> >> post, it makes it difficult to follow the thread.  Insert your reply
> >> >> inline in previous message.  Thanks)
> >> >
> >> >
> >> > Here is the log,
> >> > Started GET
> >> > "/contacts/212?utf8=%E2%9C%93&contact_tokens=&commit=Show+Details" for
> >> > 127.0.0.1 at Mon Aug 13 13:08:33 +0530 2012
> >> > Processing by ContactsController#show as JS
> >> >   Parameters: {"utf8"=>"✓", "id"=>"212", "commit"=>"Show Details",
> >> > "contact_tokens"=>""}
> >> >   User Load (0.2ms)  SELECT "users".* FROM "users" WHERE (username
> >> > ='sumit')
> >> > LIMIT 1
> >> >   Contact Load (0.2ms)  SELECT "contacts".* FROM "contacts" WHERE
> >> > "contacts"."id" = ? LIMIT 1  [["id", "212"]]
> >> >   Rendered contacts/_show.html.erb (0.8ms)
> >> >   Rendered contacts/show.js.erb (2.0ms)
> >> > Completed 200 OK in 7ms (Views: 4.1ms | ActiveRecord: 0.4ms)
> >>
> >> Strange.  I suggest checking there is no error in the html of the page
> >> with the form on.  Copy the complete html source out of your browser
> >> (View > Page Source or similar) and paste it into the w3c html
> >> validator at http://validator.w3.org/#validate_by_input.
> >>
> >> Colin
> >>
> >
> > Here is my code, validator was marking ruby code as errors.
>
> What do you mean it was marking the ruby code as errors?  It is the
> html that you are supposed to be validating.
>
> Colin
>
>
I verified the html for the view. No error related to the form was found.
What else could be the problem?


> >
> >>
> >> 
> >> <%= render 'welcome' %>
> >> 
> >>
> >> Search :
> >> <%= form_tag({:action => 'show', :id => "212", :contact_tokens =>
> >> @contact_tokens}, :remote => true, :method=> :get) do %>
> >>
> >> 
> >> <%= label_tag "contact_tokens" %>
> >> <%= text_field_tag "contact_tokens", @contact_tokens %>
> >> 
> >>
> >> 
> >>
> >> <%= submit_tag "Show Details" %>
> >> 
> >> <% end %>
> >
> >
> >>
> >> Listing contacts
> >> <%= javascript_include_tag 'lowpro' %>
> >> <% javascript_include_tag 'pagination' %>
> >>
> >> 
> >> <%= render 'contact' %>
> >> 
> >>
> >
> >
> >>
> >>
> >>
> >> >
> >> >
> >> >>
> >> >> > The power of imagination makes us infinite...
> >> >>
> >> >> I am quite happy the size I am thanks.
> >> >>
> >> >> Colin
> >> >>
> >> >> >
> >> >> >
> >> >> > On 13 August 2012 12:27, Colin Law  wrote:
> >> >> >>
> >> >> >> On 13 August 2012 07:12, Sumit Srivastava  >
> >> >> >> wrote:
> >> >> >> > Hi,
> >> >> >> >
> >> >> >> > I made a contact manager app using rails. I added TokenInput
> >> >> >> > plugin
> >> >> >> > to
> >> >> >> > introduce an instant contact search functionality in it. Tried
> >> >> >> > following
> >> >> >> > a
> >> >> >> > railscast http://railscasts.com/episodes/258-token-fields but
> have
> >> >> >> > been
> >> >> >> > struggling with it for a while. Following is the code I use in
> my
> >> >> >> > view
> >> >> >> >
> >> >> >> >> <%= form_tag({:action => 'show', :id => @contact_tokens},
> :remote
> >> >> >> >> =>
> >> >> >> >> true,
> >> >> >> >> :method=> :get) do %>
> >> >> >> >> 
> >> >> >> >> <%= label_tag "contact_tokens" %>
> >> >> >> >> <%= text_field_tag "contact_tokens", @contact_tokens %>
> >> >> >> >> 
> >> >> >> >>
> >> >> >> >> 
> >> >> >> >> <%= submit_tag "Show Details" %>
> >> >> >> >> 
> >> >> >> >> <% end %>
> >> >> >> >
> >> >> >> >
> >> >> >> >  Where, Show is the action where this particular contact will be
> >> >> >> > displayed.
> >> >> >> > But when I am trying to render this view, it show following
> error,
> >> >> >> >
> >> >> >> > No matching routes found for {controller "Contacts", action
> "Show"
> >> >> >> > id=>nil"}
> >> >> >> >
> >> >> >> > I am not able to understand why is it showing id as nil. Or say
> >> >> >> > why
> >> >> >> > isn't
> >> >> >> > anything being passed from the text field used for the search.
> >> >> >>
> >> >> >> Have a look in log/development.log to see what parameters are
> being
> >> >> >> passed when you click the link.  Then have a look at the Rails
> Guide
> >> >> >> on Debugging which will show you techniques that you can use to
> >> >> >> debug
> >> >> >> the code.
> >> >> >>
> >> >> >> Colin
> >> >> >>
> >> >> >> --
> >> >> >> You received this message b

Re: [Rails] Using Jquery plugin "tokenInput" with rails

2012-08-13 Thread Colin Law
On 13 August 2012 10:19, sumit srivastava  wrote:
>
>>
>
> On 13 August 2012 14:33, Colin Law  wrote:
>>
>> On 13 August 2012 09:45, Sumit Srivastava 
>> wrote:
>> >
>> >
>> > On Monday, 13 August 2012 14:02:11 UTC+5:30, Colin Law wrote:
>> >>
>> >> On 13 August 2012 08:40, sumit srivastava 
>> >> wrote:
>> >> > I went through the log. The contact_tokens parameter is being passed
>> >> > as
>> >> > nil,
>> >> > i.e., "contact_tokens"=>"".
>> >> >
>> >> > This is happening even when the text field is actually populated.
>> >>
>> >> Can you post that section of the log please.  (And please don't top
>> >> post, it makes it difficult to follow the thread.  Insert your reply
>> >> inline in previous message.  Thanks)
>> >
>> >
>> > Here is the log,
>> > Started GET
>> > "/contacts/212?utf8=%E2%9C%93&contact_tokens=&commit=Show+Details" for
>> > 127.0.0.1 at Mon Aug 13 13:08:33 +0530 2012
>> > Processing by ContactsController#show as JS
>> >   Parameters: {"utf8"=>"✓", "id"=>"212", "commit"=>"Show Details",
>> > "contact_tokens"=>""}
>> >   User Load (0.2ms)  SELECT "users".* FROM "users" WHERE (username
>> > ='sumit')
>> > LIMIT 1
>> >   Contact Load (0.2ms)  SELECT "contacts".* FROM "contacts" WHERE
>> > "contacts"."id" = ? LIMIT 1  [["id", "212"]]
>> >   Rendered contacts/_show.html.erb (0.8ms)
>> >   Rendered contacts/show.js.erb (2.0ms)
>> > Completed 200 OK in 7ms (Views: 4.1ms | ActiveRecord: 0.4ms)
>>
>> Strange.  I suggest checking there is no error in the html of the page
>> with the form on.  Copy the complete html source out of your browser
>> (View > Page Source or similar) and paste it into the w3c html
>> validator at http://validator.w3.org/#validate_by_input.
>>
>> Colin
>>
>
> Here is my code, validator was marking ruby code as errors.

What do you mean it was marking the ruby code as errors?  It is the
html that you are supposed to be validating.

Colin

>
>>
>> 
>> <%= render 'welcome' %>
>> 
>>
>> Search :
>> <%= form_tag({:action => 'show', :id => "212", :contact_tokens =>
>> @contact_tokens}, :remote => true, :method=> :get) do %>
>>
>> 
>> <%= label_tag "contact_tokens" %>
>> <%= text_field_tag "contact_tokens", @contact_tokens %>
>> 
>>
>> 
>>
>> <%= submit_tag "Show Details" %>
>> 
>> <% end %>
>
>
>>
>> Listing contacts
>> <%= javascript_include_tag 'lowpro' %>
>> <% javascript_include_tag 'pagination' %>
>>
>> 
>> <%= render 'contact' %>
>> 
>>
>
>
>>
>>
>>
>> >
>> >
>> >>
>> >> > The power of imagination makes us infinite...
>> >>
>> >> I am quite happy the size I am thanks.
>> >>
>> >> Colin
>> >>
>> >> >
>> >> >
>> >> > On 13 August 2012 12:27, Colin Law  wrote:
>> >> >>
>> >> >> On 13 August 2012 07:12, Sumit Srivastava 
>> >> >> wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > I made a contact manager app using rails. I added TokenInput
>> >> >> > plugin
>> >> >> > to
>> >> >> > introduce an instant contact search functionality in it. Tried
>> >> >> > following
>> >> >> > a
>> >> >> > railscast http://railscasts.com/episodes/258-token-fields but have
>> >> >> > been
>> >> >> > struggling with it for a while. Following is the code I use in my
>> >> >> > view
>> >> >> >
>> >> >> >> <%= form_tag({:action => 'show', :id => @contact_tokens}, :remote
>> >> >> >> =>
>> >> >> >> true,
>> >> >> >> :method=> :get) do %>
>> >> >> >> 
>> >> >> >> <%= label_tag "contact_tokens" %>
>> >> >> >> <%= text_field_tag "contact_tokens", @contact_tokens %>
>> >> >> >> 
>> >> >> >>
>> >> >> >> 
>> >> >> >> <%= submit_tag "Show Details" %>
>> >> >> >> 
>> >> >> >> <% end %>
>> >> >> >
>> >> >> >
>> >> >> >  Where, Show is the action where this particular contact will be
>> >> >> > displayed.
>> >> >> > But when I am trying to render this view, it show following error,
>> >> >> >
>> >> >> > No matching routes found for {controller "Contacts", action "Show"
>> >> >> > id=>nil"}
>> >> >> >
>> >> >> > I am not able to understand why is it showing id as nil. Or say
>> >> >> > why
>> >> >> > isn't
>> >> >> > anything being passed from the text field used for the search.
>> >> >>
>> >> >> Have a look in log/development.log to see what parameters are being
>> >> >> passed when you click the link.  Then have a look at the Rails Guide
>> >> >> on Debugging which will show you techniques that you can use to
>> >> >> debug
>> >> >> the code.
>> >> >>
>> >> >> 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 rubyonra...@googlegroups.com.
>> >> >> To unsubscribe from this group, send email to
>> >> >> rubyonrails-ta...@googlegroups.com.
>> >> >> For more options, visit https://groups.google.com/groups/opt_out.
>> >> >>
>> >> >>
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "Ruby on Rails: Talk" group.
>> >> > To p

Re: [Rails] Using Jquery plugin "tokenInput" with rails

2012-08-13 Thread Sumit Srivastava


On Monday, 13 August 2012 14:02:11 UTC+5:30, Colin Law wrote:
>
> On 13 August 2012 08:40, sumit srivastava 
> > 
> wrote: 
> > I went through the log. The contact_tokens parameter is being passed as 
> nil, 
> > i.e., "contact_tokens"=>"". 
> > 
> > This is happening even when the text field is actually populated. 
>
> Can you post that section of the log please.  (And please don't top 
> post, it makes it difficult to follow the thread.  Insert your reply 
> inline in previous message.  Thanks) 
>

Here is the log,
Started GET 
"/contacts/212?utf8=%E2%9C%93&contact_tokens=&commit=Show+Details" for 
127.0.0.1 at Mon Aug 13 13:08:33 +0530 2012
Processing by ContactsController#show as JS
  Parameters: {"utf8"=>"✓", "id"=>"212", "commit"=>"Show Details", 
"contact_tokens"=>""}
  User Load (0.2ms)  SELECT "users".* FROM "users" WHERE (username 
='sumit') LIMIT 1
  Contact Load (0.2ms)  SELECT "contacts".* FROM "contacts" WHERE 
"contacts"."id" = ? LIMIT 1  [["id", "212"]]
  Rendered contacts/_show.html.erb (0.8ms)
  Rendered contacts/show.js.erb (2.0ms)
Completed 200 OK in 7ms (Views: 4.1ms | ActiveRecord: 0.4ms)

 

> > The power of imagination makes us infinite... 
>
> I am quite happy the size I am thanks. 
>
> Colin 
>
> > 
> > 
> > On 13 August 2012 12:27, Colin Law > 
> wrote: 
> >> 
> >> On 13 August 2012 07:12, Sumit Srivastava 
> >> > 
>
> >> wrote: 
> >> > Hi, 
> >> > 
> >> > I made a contact manager app using rails. I added TokenInput plugin 
> to 
> >> > introduce an instant contact search functionality in it. Tried 
> following 
> >> > a 
> >> > railscast http://railscasts.com/episodes/258-token-fields but have 
> been 
> >> > struggling with it for a while. Following is the code I use in my 
> view 
> >> > 
> >> >> <%= form_tag({:action => 'show', :id => @contact_tokens}, :remote => 
> >> >> true, 
> >> >> :method=> :get) do %> 
> >> >>  
> >> >> <%= label_tag "contact_tokens" %> 
> >> >> <%= text_field_tag "contact_tokens", @contact_tokens %> 
> >> >>  
> >> >> 
> >> >>  
> >> >> <%= submit_tag "Show Details" %> 
> >> >>  
> >> >> <% end %> 
> >> > 
> >> > 
> >> >  Where, Show is the action where this particular contact will be 
> >> > displayed. 
> >> > But when I am trying to render this view, it show following error, 
> >> > 
> >> > No matching routes found for {controller "Contacts", action "Show" 
> >> > id=>nil"} 
> >> > 
> >> > I am not able to understand why is it showing id as nil. Or say why 
> >> > isn't 
> >> > anything being passed from the text field used for the search. 
> >> 
> >> Have a look in log/development.log to see what parameters are being 
> >> passed when you click the link.  Then have a look at the Rails Guide 
> >> on Debugging which will show you techniques that you can use to debug 
> >> the code. 
> >> 
> >> 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 
> >> rubyonra...@googlegroups.com. 
>
> >> To unsubscribe from this group, send email to 
> >> rubyonrails-ta...@googlegroups.com . 
> >> For more options, visit https://groups.google.com/groups/opt_out. 
> >> 
> >> 
> > 
> > -- 
> > 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 
> > rubyonra...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > rubyonrails-ta...@googlegroups.com . 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/_g-6sY85LA4J.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Using Jquery plugin "tokenInput" with rails

2012-08-13 Thread Colin Law
On 13 August 2012 08:40, sumit srivastava  wrote:
> I went through the log. The contact_tokens parameter is being passed as nil,
> i.e., "contact_tokens"=>"".
>
> This is happening even when the text field is actually populated.

Can you post that section of the log please.  (And please don't top
post, it makes it difficult to follow the thread.  Insert your reply
inline in previous message.  Thanks)

> The power of imagination makes us infinite...

I am quite happy the size I am thanks.

Colin

>
>
> On 13 August 2012 12:27, Colin Law  wrote:
>>
>> On 13 August 2012 07:12, Sumit Srivastava 
>> wrote:
>> > Hi,
>> >
>> > I made a contact manager app using rails. I added TokenInput plugin to
>> > introduce an instant contact search functionality in it. Tried following
>> > a
>> > railscast http://railscasts.com/episodes/258-token-fields but have been
>> > struggling with it for a while. Following is the code I use in my view
>> >
>> >> <%= form_tag({:action => 'show', :id => @contact_tokens}, :remote =>
>> >> true,
>> >> :method=> :get) do %>
>> >> 
>> >> <%= label_tag "contact_tokens" %>
>> >> <%= text_field_tag "contact_tokens", @contact_tokens %>
>> >> 
>> >>
>> >> 
>> >> <%= submit_tag "Show Details" %>
>> >> 
>> >> <% end %>
>> >
>> >
>> >  Where, Show is the action where this particular contact will be
>> > displayed.
>> > But when I am trying to render this view, it show following error,
>> >
>> > No matching routes found for {controller "Contacts", action "Show"
>> > id=>nil"}
>> >
>> > I am not able to understand why is it showing id as nil. Or say why
>> > isn't
>> > anything being passed from the text field used for the search.
>>
>> Have a look in log/development.log to see what parameters are being
>> passed when you click the link.  Then have a look at the Rails Guide
>> on Debugging which will show you techniques that you can use to debug
>> the code.
>>
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Re: [ANN] Rails 3.2.8 has been released!

2012-08-13 Thread Sergey Ezhov
Hi!

In 3.2.7 this code was possible if 'auto_models_for_select' is nil :
<%= select_tag :model, auto_models_for_select, :include_blank => true, 
:disabled => auto_models_for_select.nil? %>

In 3.2.8 this should be :
<%= select_tag :model, auto_models_for_select || '', :include_blank => 
true, :disabled => auto_models_for_select.nil? %>

Second parameter nil raise exception.
Please, return back that it was possible to transfer nil of second 
parameter - options.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Using Jquery plugin "tokenInput" with rails

2012-08-13 Thread sumit srivastava
I went through the log. The contact_tokens parameter is being passed as
nil, i.e., "contact_tokens"=>"".

This is happening even when the text field is actually populated.

Regards
Sumit Srivastava

The power of imagination makes us infinite...


On 13 August 2012 12:27, Colin Law  wrote:

> On 13 August 2012 07:12, Sumit Srivastava 
> wrote:
> > Hi,
> >
> > I made a contact manager app using rails. I added TokenInput plugin to
> > introduce an instant contact search functionality in it. Tried following
> a
> > railscast http://railscasts.com/episodes/258-token-fields but have been
> > struggling with it for a while. Following is the code I use in my view
> >
> >> <%= form_tag({:action => 'show', :id => @contact_tokens}, :remote =>
> true,
> >> :method=> :get) do %>
> >> 
> >> <%= label_tag "contact_tokens" %>
> >> <%= text_field_tag "contact_tokens", @contact_tokens %>
> >> 
> >>
> >> 
> >> <%= submit_tag "Show Details" %>
> >> 
> >> <% end %>
> >
> >
> >  Where, Show is the action where this particular contact will be
> displayed.
> > But when I am trying to render this view, it show following error,
> >
> > No matching routes found for {controller "Contacts", action "Show"
> id=>nil"}
> >
> > I am not able to understand why is it showing id as nil. Or say why isn't
> > anything being passed from the text field used for the search.
>
> Have a look in log/development.log to see what parameters are being
> passed when you click the link.  Then have a look at the Rails Guide
> on Debugging which will show you techniques that you can use to debug
> the code.
>
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.