Hi
I frequently use link_to in the context of conditional statement,
What do you think about a link helper that return nil when the condition is
false
ex:
# condtional = nil || false
%= link_to_if conditional, an_url, allow_hide: true % # = nil
or
%= link_to_if! conditional, an_url % #
/link_to_unless
On 17 Dec 2013, at 14:43, angelo capilleri capi...@gmail.comjavascript:
wrote:
Hi
I frequently use link_to in the context of conditional statement,
What do you think about a link helper that return nil when the condition
is false
ex:
# condtional = nil || false
%= link_to_if
I want made a PR to get the possibility to add more attribute for
errors.add method:
Ex.
Now:
...
validate dates_must_be_coherent
def dates must be coherent
if start.present? stop.present? start stop
errors.add(:start,date must be )
errors.add(:stop,date must be)
, 2012 9:14:33 AM UTC-5, angelo capilleri wrote:
Hi,
I'm thinking about a method that responds true or false for the changes
of
attributes from a value to another to trace a little bit the status of
an AR
object.
Ex.
class Book ActiveRecord::Base
STATUS_DELIVER = [0,1
Hi,
I'm thinking about a method that responds true or false for the changes of
attributes from a value to another to trace a little bit the status of an
AR object.
Ex.
class Book ActiveRecord::Base
STATUS_DELIVER = [0,1]
before_save :send_mail_to_customer
def send_mail_to_customer
Many users try to overwrite the to_param method of AR to add more
expressivness and value of Seo to the url using something like the
following:
def to_param
id.to_s + title. parameterize + '-' + author. parameterize
end
That generate url like that:
http://host/books/10-goodbook-guest
Frequently, I want use some validation with no error that blocks the
updating or saving process, but give an object with some usefull
informations to the controller.
So i thing that a 'notice' option could be added to ActiveModel.
For example
validate :age, :numericality = true, :notice=true
Could useful set the tag of a collection when you render it, like
backboneJS?
for example , given a partial:
```erb
span%=post.autor%/span
span%=post.created_at%/span
```
you could render inside two different tags
```erb
ul
%= render @posts,:tag='li'%
/ul
```
output:
```html
ul
li