Ruby on Rails Saturday, August 31, 2013

just do google "rails tutorial", click on very first search result link ;-)

On Aug 31, 2013 7:25 PM, "Dheeraj Kumar" <a.dheeraj.kumar@gmail.com> wrote:
You would need a separate controller to handle the sign-in part, with its own views. When it's successful, it should redirect you to the A controller. This is how most apps do it.

-- 
Dheeraj Kumar

On Sunday 1 September 2013 at 3:48 AM, Rita Ferreira wrote:

Hi,
I'm with a very basic doubt in MVC in RoR. I'm new at RoR, I had never developed an app in Rails since the beggining, just few things separately.

I want to have a sign in page, like the first page the user see.
After sign in I will have another page where I have a menu where user can do the basis operations (new, edit, show, ...).

The stuture of the webpage is:
sign_in page -> page with basic operations -> operations

After creating the controller/views/model to do those operations, in which page should I put the sign in page?
I mean the sign in page is not related to the controller, so on /app/views should I create another file (see below), for instance called index.html.erb? 

If controller is named A, I will have the  following structure:

/app/controller
- A_controller.rb
/app/views/A
- edit.html.erb
- new.html.erb
- show.html.erb
- (index.html.erb) --------> for sign in page?
- (index_2.html.erb) --------> page with basic operations?


After do the sign in it will be redirected to the page where I will have buttons (for instance) with new, edit, show operations, this page should be another page created by me (again) on the app/views/A ?

How do you do it?
I don't know if you understand my problem. Please if not tell me, all help is welcome.

Thanks
Rita

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8be98eb6-526b-4efe-ab4c-281b31e045a3%40googlegroups.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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/28EEB66C857F4808BB4748F49AE7FAB4%40gmail.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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAAVKU-O%3D3Z_C8TnSsTasEVr1u2Kb4e6O1uCtDvf_dQnaUBwdRA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

You would need a separate controller to handle the sign-in part, with its own views. When it's successful, it should redirect you to the A controller. This is how most apps do it.

-- 
Dheeraj Kumar

On Sunday 1 September 2013 at 3:48 AM, Rita Ferreira wrote:

Hi,
I'm with a very basic doubt in MVC in RoR. I'm new at RoR, I had never developed an app in Rails since the beggining, just few things separately.

I want to have a sign in page, like the first page the user see.
After sign in I will have another page where I have a menu where user can do the basis operations (new, edit, show, ...).

The stuture of the webpage is:
sign_in page -> page with basic operations -> operations

After creating the controller/views/model to do those operations, in which page should I put the sign in page?
I mean the sign in page is not related to the controller, so on /app/views should I create another file (see below), for instance called index.html.erb? 

If controller is named A, I will have the  following structure:

/app/controller
- A_controller.rb
/app/views/A
- edit.html.erb
- new.html.erb
- show.html.erb
- (index.html.erb) --------> for sign in page?
- (index_2.html.erb) --------> page with basic operations?


After do the sign in it will be redirected to the page where I will have buttons (for instance) with new, edit, show operations, this page should be another page created by me (again) on the app/views/A ?

How do you do it?
I don't know if you understand my problem. Please if not tell me, all help is welcome.

Thanks
Rita

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8be98eb6-526b-4efe-ab4c-281b31e045a3%40googlegroups.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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/28EEB66C857F4808BB4748F49AE7FAB4%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,
I'm with a very basic doubt in MVC in RoR. I'm new at RoR, I had never developed an app in Rails since the beggining, just few things separately.

I want to have a sign in page, like the first page the user see.
After sign in I will have another page where I have a menu where user can do the basis operations (new, edit, show, ...).

The stuture of the webpage is:
sign_in page -> page with basic operations -> operations

After creating the controller/views/model to do those operations, in which page should I put the sign in page?
I mean the sign in page is not related to the controller, so on /app/views should I create another file (see below), for instance called index.html.erb? 

If controller is named A, I will have the  following structure:

/app/controller
- A_controller.rb
/app/views/A
- edit.html.erb
- new.html.erb
- show.html.erb
- (index.html.erb) --------> for sign in page?
- (index_2.html.erb) --------> page with basic operations?


After do the sign in it will be redirected to the page where I will have buttons (for instance) with new, edit, show operations, this page should be another page created by me (again) on the app/views/A ?

How do you do it?
I don't know if you understand my problem. Please if not tell me, all help is welcome.

Thanks
Rita

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8be98eb6-526b-4efe-ab4c-281b31e045a3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails Friday, August 30, 2013

I have a rails app that lists different law firms. These law firms can be categorized by Practice Area and Location. Now i need to implement a search, where people can select from a select option a Location AND a Practice Area and find all Law Firms that are in that selected Location which also Practice in the selected Area, any idea?
Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5ba1e91e-9538-4585-a621-92d1bf986ac2%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,

I am a newbie to Ruby. I have installed and set up Netbeans in windows
7. I have created a new project but i am not able to see Gemfile in the
project tree view. can some one help me.

thanks
vijay

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fe52bf6b6855cf301c5f8c85dc56f96b%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Fri, Aug 30, 2013 at 8:40 AM, Paulo Castro <lists@ruby-forum.com> wrote:
> I mean, when I execute the code bellow from web browser..
> I'm using apache+phusionpassenger
>
> Please, anyone has any idea? I couldn't find anything to help yet!!

First make sure your OpenSSL is working fine, then make sure you've
the SSL headers installed and recompile Ruby. Also, see if the
simplest form of connection works:

require "net/https"
Net::HTTP.get(URI.parse("https://us1.api.mailchimp.com/2.0/helper/ping"))

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAM5XQny_q-Ob07tz2WqSkFzeZu4UA%2BjTg4Hda1fWTHQcB%3D6Syg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 30 August 2013 14:40, Paulo Castro <lists@ruby-forum.com> wrote:
> I mean, when I execute the code bellow from web browser..

How are you executing it from a browser?

Colin

> I'm using apache+phusionpassenger
>
> Please, anyone has any idea? I couldn't find anything to help yet!!
>
> Thank you all in advance!
>
>
>
> Paulo Castro wrote in post #1119935:
>> Hi guys
>>
>> when I execute the piece of code bellow on RoR console it works fine:
>>
>> url = URI.parse("https://us1.api.mailchimp.com/2.0/helper/ping")
>> request = Net::HTTP::Post.new(url.path)
>> http = Net::HTTP.new(url.host, url.port)
>> http.use_ssl = true
>> http.verify_mode = OpenSSL::SSL::VERIFY_NONE
>> request.body = "{\"apikey\": \"myapikey\"}"
>>
>> response = http.start {|http| http.request(request) }
>>
>>
>> But when I try to use it on my RoR app I get the following error:
>>
>> OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=unknown
>> state: sslv3 alert handshake failure)
>>
>> Someone know what could be happening?
>>
>> Thank you all in advance!
>>
>> Best regards
>>
>> Paulo
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cb5e7be2093001259cb7970923515a06%40ruby-forum.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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu76Waz3F4FrXFd288jO7VjgjTOb09KTVZFeyCFC0rj3g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I mean, when I execute the code bellow from web browser..
I'm using apache+phusionpassenger

Please, anyone has any idea? I couldn't find anything to help yet!!

Thank you all in advance!



Paulo Castro wrote in post #1119935:
> Hi guys
>
> when I execute the piece of code bellow on RoR console it works fine:
>
> url = URI.parse("https://us1.api.mailchimp.com/2.0/helper/ping")
> request = Net::HTTP::Post.new(url.path)
> http = Net::HTTP.new(url.host, url.port)
> http.use_ssl = true
> http.verify_mode = OpenSSL::SSL::VERIFY_NONE
> request.body = "{\"apikey\": \"myapikey\"}"
>
> response = http.start {|http| http.request(request) }
>
>
> But when I try to use it on my RoR app I get the following error:
>
> OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=unknown
> state: sslv3 alert handshake failure)
>
> Someone know what could be happening?
>
> Thank you all in advance!
>
> Best regards
>
> Paulo

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cb5e7be2093001259cb7970923515a06%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 30 August 2013 13:47, Tsolmon Narantsogt <mnts26@gmail.com> wrote:
> I have to connect to an existing database.
> But i got
>
> ActiveRecord::DangerousAttributeError
> frozen? is defined by ActiveRecord

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

Have you got a column in the db called frozen? If so then it is
warning you that the name conflicts with an ActiveRecord method.

Colin

>
> My code is here:
>
> class Customer < ActiveRecord::Base
> establish_connection :my_connection
> self.table_name = 'customer'
>
> self.primary_key = 'customer_no'
> def self.get_all_customer
> @customer_data = Customer.find_by_sql("select customer_no from
> customer_table")
>
> return @customer_data
> end
> end
>
> Thanks
>
>
> On Fri, Aug 30, 2013 at 8:37 PM, Colin Law <clanlaw@googlemail.com> wrote:
>>
>> On 30 August 2013 13:33, Tsolmon Narantsogt <mnts26@gmail.com> wrote:
>> > Hello folks
>> >
>> >
>> > I got that error Pls tell me what's wrong
>> >
>> > frozen? is defined by ActiveRecord
>>
>> We are not telepathic so without knowing what you are doing it is
>> impossible to say. Post the full error and stack trace (if any) and
>> the section of code causing the problem. Not your whole app just a
>> few lines around the area where the problem occurs.
>>
>> Colin
>>
>> >
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Ruby on Rails: Talk" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to rubyonrails-talk+unsubscribe@googlegroups.com.
>> > To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/rubyonrails-talk/CAPs6WSe4y1iYPihgdRSSFu4rYcsJdXEePKLFd8EaJ%3D3zTYqk_A%40mail.gmail.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 unsubscribe from this group and stop receiving emails from it, send an
>> email to rubyonrails-talk+unsubscribe@googlegroups.com.
>> To post to this group, send email to rubyonrails-talk@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLth%2Bhye3H%2BHJn88XvDFE8ReOsTnc3uq0qRFYLsq9XXoEw%40mail.gmail.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 unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/CAPs6WScQTOAtNu9vvcVO%3Dmwf%3D5%2BJfwTKMpusWF_Z8BAHAuOJyA%40mail.gmail.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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLt95_h%3D_-Fvw4s3yjWaF4aWzvXi0fcmMDH_rgHto%2BcqjA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I have to connect to an existing database.
But i got
ActiveRecord::DangerousAttributeError   frozen? is defined by ActiveRecord

  My code is here:
class Customer < ActiveRecord::Base
establish_connection :my_connection
self.table_name = 'customer'
self.primary_key = 'customer_no'
def self.get_all_customer
@
customer_data = Customer.find_by_sql("select customer_no from customer_table")
return @customer_data
end
end

Thanks


On Fri, Aug 30, 2013 at 8:37 PM, Colin Law <clanlaw@googlemail.com> wrote:
On 30 August 2013 13:33, Tsolmon Narantsogt <mnts26@gmail.com> wrote:
> Hello folks
>
>
> I got that error Pls tell me what's wrong
>
> frozen? is defined by ActiveRecord

We are not telepathic so without knowing what you are doing it is
impossible to say.  Post the full error and stack trace  (if any) and
the section of code causing the problem.  Not your whole app just a
few lines around the area where the problem occurs.

Colin

>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/CAPs6WSe4y1iYPihgdRSSFu4rYcsJdXEePKLFd8EaJ%3D3zTYqk_A%40mail.gmail.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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLth%2Bhye3H%2BHJn88XvDFE8ReOsTnc3uq0qRFYLsq9XXoEw%40mail.gmail.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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPs6WScQTOAtNu9vvcVO%3Dmwf%3D5%2BJfwTKMpusWF_Z8BAHAuOJyA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

FIXED
I had the restart_command in puma.rb trying to run 'puma.sock restart', I pointed it to my init.d file and it no longer has an issue when it boots workers

restart_command '/etc/init.d/puma restart'

I still occasionally get a 504 timeout under very heavy load, but i have the god gem monitoring too and it recovers from that quickly




On Thursday, August 29, 2013 5:51:24 PM UTC-4, Rob Daniels wrote:
I'm having an issue with Puma, it fails when it tries to restart itself. When this happens it kills all the Puma processes, resulting in nginx delivering a 502 Bad Gateway to our users. I'm able to start, stop & restart it with my /etc/init.d/puma script (it runs /usr/local/bin/run-puma),  it just has issues when it restarts itself. The puma.log file doesn't show anything just useful for troubleshooting, just

Puma starting in single mode...
* Version 2.5.1, codename: Astronaut Shoelaces
* Min threads: 16, max threads: 32
* Environment: production
* Listening on unix:///home/deploy/app/shared/sockets/puma.sock

and my workers. Any help would be greatly appreciated.

Also - i have whats probably a pretty dumb question. Is there a way for me to allocate more resources to Puma so it doesn't need to restart itself so frequently? I'm currently only using around 25% of the server's memory.

Thanks for the help

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/57281308-5f55-49ce-bec3-2a06a6e9c592%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 30 August 2013 13:33, Tsolmon Narantsogt <mnts26@gmail.com> wrote:
> Hello folks
>
>
> I got that error Pls tell me what's wrong
>
> frozen? is defined by ActiveRecord

We are not telepathic so without knowing what you are doing it is
impossible to say. Post the full error and stack trace (if any) and
the section of code causing the problem. Not your whole app just a
few lines around the area where the problem occurs.

Colin

>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/CAPs6WSe4y1iYPihgdRSSFu4rYcsJdXEePKLFd8EaJ%3D3zTYqk_A%40mail.gmail.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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLth%2Bhye3H%2BHJn88XvDFE8ReOsTnc3uq0qRFYLsq9XXoEw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hello folks


I got that error Pls tell me what's wrong
frozen? is defined by ActiveRecord



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAPs6WSe4y1iYPihgdRSSFu4rYcsJdXEePKLFd8EaJ%3D3zTYqk_A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I have a scenario where I need to retrieve an array of specific
attributes from a table. I have a TransportAttendanceBlock table. In the
table I have blocked(boolean) and blocked_date attributes. From a
controller I am fetching this table by passing params of date and
boolean value.

Controller code:
@blocked_date =
TransportAttendanceBlock.by_blocked_date_and_blocked(@today,1)
Model
named_scope :by_blocked_date_and_blocked, lambda{|date,status|
{:conditions=>
{:blocked_date=>date.beginning_of_month..date.end_of_month,
:blocked=>status}}}

Here in the controller I am getting the entire objects of
TransportAttendanceBlock table.
But I need to just pass any array of dates only in the @blocked_date
variable as json.
So how do I extract only blocked_date attributes and assign it to
@blocked_date variable. Please help. I am using rails2.3 and ruby 1.8.7

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b52648e4fee98de31e2c994f7aed110d%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Thu, Aug 29, 2013 at 2:29 PM, starfry <google@jelmail.com> wrote:
I have been working on updating a rails application to 4.0 and spent some time getting to the bottom of why it wasn't working.

What I found was, if a model has a method_missing definition then it is called instead of any accessors. This causes any model set-up to fail.


As far as I am aware, the accessors for attributes have always been generated using method_missing (the method missing hook then actually defines the accessors, so after that method missing is not used).

What might possibly have changed is when this gets triggered. Regardless if you do override method_missing it's a good idea to call to the superclass as other aspects of active record may rely on this.

Fred

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CABp077WR%3Du88x0R-T%3D6tHf73mQvk2rSpKhZ1EkMY5oxcuHzrZg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 30 August 2013 09:00, honey ruby <emailtohoneyruby@gmail.com> wrote:
> Hi all
>
> There is a scenario with 2 tables.
> I will insert the one row in table 1 and after I save my row in table one I
> want that Id to be saved in another table immediately how to approach this
> scenario.

Which bit don't you know how to do?
Where to put the code?
How to determine the id of the row?
How to find the record in the second table?
How to change the value in the second table?
How to save the value in the second table?
Something else?

But before that the more important question is whether you should have
a belongs_to, has_many (or similar) association between the tables so
that rails will do most of the work for you.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLs40oJi2b1B2de9qJ0MFxk9NRwRAduTaJMpi5SmjOTEtA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi all

There is a scenario with 2 tables.
I will insert the one row in table 1 and after I save my row in table one I want that Id to be saved in another table immediately how to approach this scenario.
kindly help  me




Regards,
Honey 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8dcf4c68-a521-4afe-922c-aeeb0a692d9d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails Thursday, August 29, 2013

On Aug 29, 2013, at 2:16 PM, Love U Ruby <lists@ruby-forum.com> wrote:
> Please help me to understand what does mean by "If used with no
> arguments, subsequently defined methods become module functions."?

That means you can use it as a means of saying "All the methods defined below are module functions":


Module M

def foo
end

module_function

def bar
end

def baz
end

end

and so you can then call M.bar and M.baz, but not M.foo.

This is identical to:

Module M
def foo;end
def bar;end
def baz;end
module_function :bar, :baz
end

It is *also* identical to:

Module M
def foo;end
def self.bar; end
def self.baz; end
end


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/58BD364C-563B-439E-AA7B-D4068A1B521C%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

thanks for sharing! I use a PDF merger driver found on the internet .
Install it and it becomes a selectable merger option.Then you can merge
PDFs into one in any program at all, including Adobe Acrobat . Just open
the PDFs, select merge, and choice the form you want, the task will be
finished in several seconds. if you haven't found a good choice , you
can have a try. best wishes.
http://www.rasteredge.com/how-to/vb-net-imaging/pdf-merge/

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3fef4aa26e727898d4ec54dc62d2d131%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Frederick Cheung wrote in post #1120015:
> On Thursday, August 29, 2013 11:02:10 PM UTC+1, Ruby-Forum.com User
> wrote:
>>
> Dheeraj's code has optional arguments. In such circumstances arity will
> return a negative number (where -1 means that the method requires at
> least
> 0 arguments, -1 would mean a method that requires at least 1 argument
> etc...
>
>
>> Thanks Dheeraj. Quick question about the pick axe book. Have you given
>> a version a read back in the day? I am just wondering how beginner
>> friendly it is.
>>
>
> It was the first book on ruby I ever read
>
> Fred


Thanks! Look forward to reading it.

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9763ccef1080603be23d7b0164e2bb86%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On Thu, Aug 29, 2013 at 2:51 PM, Rob Daniels <r.daniels@gmail.com> wrote:
> I'm having an issue with Puma, it fails when it tries to restart itself.
> When this happens it kills all the Puma processes, resulting in nginx
> delivering a 502 Bad Gateway to our users. I'm able to start, stop & restart
> it with my /etc/init.d/puma script (it runs /usr/local/bin/run-puma), it
> just has issues when it restarts itself.

So, "restarts itself"? Do you have any idea why? I've never seen any
of my own Puma instances spontaneously restart.

Have you looked in the system logs for anything relevant? Is there
a mismatch between you-the-user-manually-starting-it and the user
that the process is normally running as/restarting as?

What Ruby are you running?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBKWmy9-O0j0NEYg9__njdyCN4By2uUuZUD97ho2X%2BaNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails



On Thursday, August 29, 2013 11:02:10 PM UTC+1, Ruby-Forum.com User wrote:

The code for the number of arguments and the part which is failing is


  it "requires two arguments" do
    method(:array_sum).arity.should eq 2
  end



Dheeraj's code has optional arguments. In such circumstances arity will return a negative number (where -1 means that the method requires at least 0 arguments, -1 would mean a method that requires at least 1 argument etc...
 
Thanks Dheeraj.  Quick question about the pick axe book. Have you given
a version a read back in the day? I am just wondering how beginner
friendly it is.

It was the first book on ruby I ever read

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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/819a7f9d-0c58-41aa-be1e-431872cd6fae%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

The arity should be -1, not 2. See the docs here: http://www.ruby-doc.org/core-1.9.3/Method.html#method-i-arity

I read the pickaxe book about three years ago, when I first started with Ruby 1.9.2. It was quite beginner friendly, and very useful. I haven't read more recent editions.

-- 
Dheeraj Kumar

On Friday 30 August 2013 at 3:32 AM, Alex Froelich wrote:

Dheeraj Kumar wrote in post #1120004:
Could you paste your test?

--
Dheeraj Kumar

The code for the number of arguments and the part which is failing is


it "requires two arguments" do
method(:array_sum).arity.should eq 2
end


Thanks Dheeraj. Quick question about the pick axe book. Have you given
a version a read back in the day? I am just wondering how beginner
friendly it is.

--

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CCE02DE6380149D1AD2EDED407E82B13%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Dheeraj Kumar wrote in post #1120004:
> Could you paste your test?
>
> --
> Dheeraj Kumar

The code for the number of arguments and the part which is failing is


it "requires two arguments" do
method(:array_sum).arity.should eq 2
end


Thanks Dheeraj. Quick question about the pick axe book. Have you given
a version a read back in the day? I am just wondering how beginner
friendly it is.

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7a5a96d399f82cfc7803630ce33503b4%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I'm having an issue with Puma, it fails when it tries to restart itself. When this happens it kills all the Puma processes, resulting in nginx delivering a 502 Bad Gateway to our users. I'm able to start, stop & restart it with my /etc/init.d/puma script (it runs /usr/local/bin/run-puma),  it just has issues when it restarts itself. The puma.log file doesn't show anything just useful for troubleshooting, just

Puma starting in single mode...
* Version 2.5.1, codename: Astronaut Shoelaces
* Min threads: 16, max threads: 32
* Environment: production
* Listening on unix:///home/deploy/app/shared/sockets/puma.sock

and my workers. Any help would be greatly appreciated.

Also - i have whats probably a pretty dumb question. Is there a way for me to allocate more resources to Puma so it doesn't need to restart itself so frequently? I'm currently only using around 25% of the server's memory.

Thanks for the help

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9ac8c9a9-ea48-40f6-87dd-2312d460925d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Could you paste your test?

-- 
Dheeraj Kumar

On Friday 30 August 2013 at 2:37 AM, Alex Froelich wrote:

Dheeraj Kumar wrote in post #1119995:
def array_sum(array1 = [], array2 = [])
array1 + array2
end

array_sum([1,2,3], [4,5,6])
=> [1, 2, 3, 4, 5, 6]


--
Dheeraj Kumar

Is there a reason why when i would run a test it would say -1 arguments
instead of 2? You had listed two (array1 = [], array2= []), I have never
actually gotten - arguments before with the spec test.

thanks!

--

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/831C9BE2A23945999A263DFFFD4B704E%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Dheeraj Kumar wrote in post #1119995:
> def array_sum(array1 = [], array2 = [])
> array1 + array2
> end
>
> array_sum([1,2,3], [4,5,6])
> => [1, 2, 3, 4, 5, 6]
>
>
> --
> Dheeraj Kumar

Is there a reason why when i would run a test it would say -1 arguments
instead of 2? You had listed two (array1 = [], array2= []), I have never
actually gotten - arguments before with the spec test.

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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0a873e3de591a2bfb3551dc08c212449%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Thanks Colin!

The "issue" was on HTML code: each faulty HTML tag was being wrapped
inside a new <div>, so the default behavior was to start a new line.

I have added "display:inline-block" in the CSS class and everything is
working perfect now.

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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b93211450efe3882d36beeaa5c4b5f08%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Dheeraj Kumar wrote in post #1119998:
> Colin is right. You should try reading a book, like this one:
> http://pragprog.com/book/ruby4/programming-ruby-1-9-2-0
>
> --
> Dheeraj Kumar

Hi Colin and Dheeraj,

First off thanks for your help. It is actually quite funny, I ordered
that exact book a few days ago :). I also worked through Chris Pine's
book, which was very nice. I always think i get the ideas, practice the
items that they show, but when it comes to solving problems I freeze up.
Guess it will come with a ton more practice and reading.

thanks for taking the time to help

Alex

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/663ea4184ef203b628be2add1681933b%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Colin is right. You should try reading a book, like this one: http://pragprog.com/book/ruby4/programming-ruby-1-9-2-0

-- 
Dheeraj Kumar

On Friday 30 August 2013 at 2:12 AM, Colin Law wrote:

On 29 August 2013 21:40, Dheeraj Kumar <a.dheeraj.kumar@gmail.com> wrote:
def array_sum(array1 = [], array2 = [])
array1 + array2
end

array_sum([1,2,3], [4,5,6])
=> [1, 2, 3, 4, 5, 6]

Also I suggest the OP works through a good Ruby primer.

Colin


--
Dheeraj Kumar

On Friday 30 August 2013 at 2:01 AM, Alex Froelich wrote:

Hello again ruby community!

I just learned how to add two arrays(I know, i know).

My program looked like this

array1=[1,2,3]
array2=[4,5,6]
array_sum=array1+array2

I thought pretty simple stuff, they are combined. However, now i am
looking to define that code as a method and I do not understand how to
create the correct number of arguments, so when the method is called
back it gives me my array_sum.

I have been trying many different variations, but it has now come down
to I am not sure if my defining is wrong or my code in the method is
incorrect.

I want to say it is something such as

def please_work()
array1=[1,2,3]
array2=[4,5,6]
array_sum=array1+array2
end
puts please_work(array_sum)

i ended up fiddling around and getting it to output [1,2,3,4,5,6], but
my syntex said i did not have the correct number of arguments. Also,
sometimes i get array_sum is not a defined variable. If I am defining it
in the method, shouldn't it be defined if i call the method again?

thanks taking a look at my question
alex

--

--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit


--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/B4B4251B48AB4C1CB48A6FA89BE382CE%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 29 August 2013 21:40, Dheeraj Kumar <a.dheeraj.kumar@gmail.com> wrote:
> def array_sum(array1 = [], array2 = [])
> array1 + array2
> end
>
> array_sum([1,2,3], [4,5,6])
> => [1, 2, 3, 4, 5, 6]

Also I suggest the OP works through a good Ruby primer.

Colin

>
> --
> Dheeraj Kumar
>
> On Friday 30 August 2013 at 2:01 AM, Alex Froelich wrote:
>
> Hello again ruby community!
>
> I just learned how to add two arrays(I know, i know).
>
> My program looked like this
>
> array1=[1,2,3]
> array2=[4,5,6]
> array_sum=array1+array2
>
> I thought pretty simple stuff, they are combined. However, now i am
> looking to define that code as a method and I do not understand how to
> create the correct number of arguments, so when the method is called
> back it gives me my array_sum.
>
> I have been trying many different variations, but it has now come down
> to I am not sure if my defining is wrong or my code in the method is
> incorrect.
>
> I want to say it is something such as
>
> def please_work()
> array1=[1,2,3]
> array2=[4,5,6]
> array_sum=array1+array2
> end
> puts please_work(array_sum)
>
> i ended up fiddling around and getting it to output [1,2,3,4,5,6], but
> my syntex said i did not have the correct number of arguments. Also,
> sometimes i get array_sum is not a defined variable. If I am defining it
> in the method, shouldn't it be defined if i call the method again?
>
> thanks taking a look at my question
> alex
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/bc0aa129b0271b8f7159b64b5d0f6fd8%40ruby-forum.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 unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/8C5A4B6AC18E4B879C13839A3B5582B4%40gmail.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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtonPh-Jfah598uFUHXbtMWTMqmFY3JsRhjqzUGnE-kKg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

def array_sum(array1 = [], array2 = [])
  array1 + array2
end

array_sum([1,2,3], [4,5,6])
=> [1, 2, 3, 4, 5, 6]

-- 
Dheeraj Kumar

On Friday 30 August 2013 at 2:01 AM, Alex Froelich wrote:

Hello again ruby community!

I just learned how to add two arrays(I know, i know).

My program looked like this

array1=[1,2,3]
array2=[4,5,6]
array_sum=array1+array2

I thought pretty simple stuff, they are combined. However, now i am
looking to define that code as a method and I do not understand how to
create the correct number of arguments, so when the method is called
back it gives me my array_sum.

I have been trying many different variations, but it has now come down
to I am not sure if my defining is wrong or my code in the method is
incorrect.

I want to say it is something such as

def please_work()
array1=[1,2,3]
array2=[4,5,6]
array_sum=array1+array2
end
puts please_work(array_sum)

i ended up fiddling around and getting it to output [1,2,3,4,5,6], but
my syntex said i did not have the correct number of arguments. Also,
sometimes i get array_sum is not a defined variable. If I am defining it
in the method, shouldn't it be defined if i call the method again?

thanks taking a look at my question
alex

--

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8C5A4B6AC18E4B879C13839A3B5582B4%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hello again ruby community!

I just learned how to add two arrays(I know, i know).

My program looked like this

array1=[1,2,3]
array2=[4,5,6]
array_sum=array1+array2

I thought pretty simple stuff, they are combined. However, now i am
looking to define that code as a method and I do not understand how to
create the correct number of arguments, so when the method is called
back it gives me my array_sum.

I have been trying many different variations, but it has now come down
to I am not sure if my defining is wrong or my code in the method is
incorrect.

I want to say it is something such as

def please_work()
array1=[1,2,3]
array2=[4,5,6]
array_sum=array1+array2
end
puts please_work(array_sum)

i ended up fiddling around and getting it to output [1,2,3,4,5,6], but
my syntex said i did not have the correct number of arguments. Also,
sometimes i get array_sum is not a defined variable. If I am defining it
in the method, shouldn't it be defined if i call the method again?

thanks taking a look at my question
alex

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bc0aa129b0271b8f7159b64b5d0f6fd8%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 29 August 2013 21:03, Jorge C. <lists@ruby-forum.com> wrote:
> Hi all,
>
> I have created a form to insert new records (see "Selección_001.png")
> with two mandatory fields ("name" and "surname") but if I try to insert
> a blank record (so it is invalid) I get the two errors (that is correct)
> but the page layout is modified (see "Selección_002.png"), which is not
> correct.
>
> As you can see "Name" label, "name" text box, "Surname" label, and
> "surname" text box are moved each one to a new line (which is different
> from to original layout)
>
> I have tried to delete ALL css files on the folder but without success
> ("Selección_003.png"), the red color disappears but the layout is still
> modified ;-(
>
> Does anybody know what file I have to update to avoid this change in my
> layout?

Using Firebug in Firefox you can inspect the css and see what is going
on. Also inspect the html and see what has changed there.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu2AtKBLg--jqaeZv-rw8S4ArODAxmDu3Sr5L0uDn3%2BMg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi all,

I have created a form to insert new records (see "Selección_001.png")
with two mandatory fields ("name" and "surname") but if I try to insert
a blank record (so it is invalid) I get the two errors (that is correct)
but the page layout is modified (see "Selección_002.png"), which is not
correct.

As you can see "Name" label, "name" text box, "Surname" label, and
"surname" text box are moved each one to a new line (which is different
from to original layout)

I have tried to delete ALL css files on the folder but without success
("Selección_003.png"), the red color disappears but the layout is still
modified ;-(

Does anybody know what file I have to update to avoid this change in my
layout?

Thanks!

Jorge

Attachments:
http://www.ruby-forum.com/attachment/8698/Selecci_n_001.jpg
http://www.ruby-forum.com/attachment/8699/Selecci_n_002.jpg
http://www.ruby-forum.com/attachment/8700/Selecci_n_003.jpg


--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d58e2d14938e2972f54496d8a56ec407%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

On 29 August 2013 20:48, Rekha Benada <rekha.benada@gmail.com> wrote:
> Hi,
>
> I am following this post http://www.sitepoint.com/ruby-social-gems-linkedin/
> for using linked gem and API for getting profile and other stuff
> But at the end I am getting this error:
>
>
>
> => Booting WEBrick
> => Rails 3.2.13 application starting in development on http://0.0.0.0:3000
> => Call with -d to detach
> => Ctrl-C to shutdown server
> Exiting
> /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:179:in
> `default_controller_and_action': missing :action (ArgumentError)

Very likely a problem with routes.rb. Post it here (after removing
all comment lines, we don't need to see those).

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLt2bjVL8u565iwkk%2BCPzA3XPhzLkZqNXNOccg6JFontEg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

I'm having a frustrating issue where my sign_in_as! helper will not fill out the password in my seeds_spec test. However all other integration tests using the helper still pass which is very confusing for me.

I put a call to sleep in for the method, and ran the test with webdrive to fill in the password manually, and the test completed as it should.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3f813207-23c2-476f-907a-238e149bcc9c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ruby on Rails

Hi,

I am following this post http://www.sitepoint.com/ruby-social-gems-linkedin/  for using linked gem and API for getting profile and other stuff
But at the end I am getting this error:



=> Booting WEBrick
=> Rails 3.2.13 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:179:in `default_controller_and_action': missing :action (ArgumentError)
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:72:in `normalize_options!'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:60:in `initialize'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1308:in `new'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1308:in `add_route'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1287:in `decomposed_match'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1269:in `block in match'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1269:in `each'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/mapper.rb:1269:in `match'
from /Users/rekha/rails_projects/linkedin_gem/config/routes.rb:7:in `block in <top (required)>'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:289:in `instance_exec'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:289:in `eval_block'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:267:in `draw'
from /Users/rekha/rails_projects/linkedin_gem/config/routes.rb:1:in `<top (required)>'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/file_update_checker.rb:78:in `call'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/file_update_checker.rb:78:in `execute'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/rekha/rails_projects/linkedin_gem/config/environment.rb:5:in `<top (required)>'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /Users/rekha/rails_projects/linkedin_gem/config.ru:3:in `block in <main>'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/rekha/rails_projects/linkedin_gem/config.ru:in `new'
from /Users/rekha/rails_projects/linkedin_gem/config.ru:in `<main>'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/rekha/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

I tried different solution as suggested by folks for changing routes.rb but not getting right one.. 
Can anyone tell what's wrong..??


Thanks

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fa781ab8-59de-48b1-998d-4b320993216f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.